my database and migrations are unsynced. I would like to delete the db, and start all over from migration 001.. Is there a way to do that?
Or,
I think I'm in migration 024, and the database from the live server is in migration 015. If I could set the current migration to be 015, then it should be solved.. How can I do that?
There are two places in which migrations are tracked: the "migration" table, and the migration config file.
The contents of the table is leading. If the table does not exist, or is empty, migrations will start with the first one.
If there are entries in the table that are not in the config file, the config file is updated with the missing entries, those migrations will not run twice (you need this in clusters when databases are replicated).
If the migrations in the config are ahead of the migrations in the table, then these entries are ignored.
You can use "migrate:current" to run the missing migrations defined in the config. This is hardly used, but it allows you to migrate to a known level instead of simply run all migrations.
For example, if you have 001 to 020, the table has up until 012, and the config has up to 016, "migrate" or "migrate:run" will migrate up to 020, while "migrate:current" will run migrations up to 016.