Repository navigation
Document Migrations - #563
Conversation
| myDbContext.Database.Migrate(); | ||
| ``` | ||
|
|
||
| > [!WARNING] |
There was a problem hiding this comment.
I think we should be more explicit about not running migrations at application startup except in very specific cases, such as testing or client apps with a local database. The advice we have generally been giving is that even if you want to use the update-database command on your production database it should only be done in a controlled environment as part of a controlled application deployment.
| b.Property<bool>("Deactivated"); | ||
| === | ||
| b.Property<int>("LoyaltyPoints"); | ||
| >>> Theirs |
There was a problem hiding this comment.
Wow, that didn't render right...
| Custom Migrations Operations | ||
| ============================ | ||
| The MigrationBuilder API allows you to perform many different kinds of operations during a migration, but it's far from | ||
| exhaustive. However, the API is also extensible allowing you to define your own operations. There are two to extend the |
There was a problem hiding this comment.
Typo: "There are two to extend..."
| } | ||
| ``` | ||
|
|
||
| Each provider can now decide what SQL to generate for this operation in their `IMigrationsSqlGenerator` service. Here is |
There was a problem hiding this comment.
Maybe note here something like "this approach only works if every provider knows how to generate SQL for the operation." To align with the similar statement above about .Sql
| <<<<<<< Mine | ||
| b.Property<bool>("Username"); | ||
| ======= | ||
| b.Property<int>("Alias"); |
There was a problem hiding this comment.
Shouldn't both properties be the same type in this example, since both are just renames?
There was a problem hiding this comment.
lol, thanks. Copy-and-paste error. I'm going to turn some of the code here (in in the tools docs) into samples.
Resolves #204
Resolves #204