-
Notifications
You must be signed in to change notification settings - Fork 58
Migrations
Ângelo Tadeucci edited this page Apr 27, 2024
·
1 revision
When making changes to the schema (Maple2.Database.Model), you will need to generate a migration to apply the changes to existing tables. This can be done by running in the terminal inside the Maple2.Server.World folder:
dotnet ef migrations add $NAME
If you need to regenerate the migration, first remove it:
dotnet ef database update $OLD_VERSION
dotnet ef migrations remove
Note: Ensure that Maple2.Server.World/Migrations/Ms2ContextModelSnapshot.cs is also reverted properly. (The tool always seems to mess it up, so you might have to manually revert it through git)
To apply the latest migration, you can again just run:
dotnet ef database update
You can also specify and optional migration name to switch between older versions:
dotnet ef database update $NAME