Which will generate an empty migration file in your migration directory:
You can then add the SQL statements for your database schema to this migration file:
Log the baseline migration
For new environments this baseline migration will automatically be run when you run emigrate up.
For any existing environments you will need to run emigrate up with the --no-execution flag to prevent the migration from being executed and only log the migration:
In case you have already added more migration files to your migration directory you can limit the “up” command to just log the baseline migration by specifying the --to option:
You can now start adding new migrations to your migration directory and run emigrate up to apply them to your database.
Which should be part of your CD pipeline to ensure that your database schema is always up to date in each environment.