Assuming that automatic migrations are disabled, if I have for instance, 4 migrations and just the first one was used to update the database:
XXX...XXX_mymigration_v1 - Migration 1
XXX...XXX_mymigration_v2 - Migration 2
XXX...XXX_mymigration_v3 - Migration 3
XXX...XXX_mymigration_v4 - Migration 4
Update-Database it will the Migration 4 applied right?Not sure why no-one has answered this earlier.
1) Yes, update-database with no parameters will update to the latest migration.
2) Migrations are applied in sequence as per the timestamp prefixed to the file name containing the migration.
3) If you want to roll back to the first migration you execute update-database -TargetMigration mymigration_v1. Note that you do not need the timestamp when specifying the migration name.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With