-
Notifications
You must be signed in to change notification settings - Fork 2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Improvements to migration docs #2430
Conversation
eed3de0
to
334f0a2
Compare
@bricelam @ajcvickers @JeremyLikness this isn't quite ready/proofed yet, but if you feel like taking a look go ahead :) I'll do another pass tomorrow and mark this ready for review. |
|
||
### Namespaces | ||
* We generally recommend using the [.NET Core CLI tools](xref:core/miscellaneous/cli/dotnet), which work on all platforms. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it fair to say we recommend the CLI over PMC as a general rule, unless otherwise? That seems to make sense, from a cross-platform cross-IDE standpoint.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, I think we should start recommending them.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also, "which works"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should it be plural because we speak of CLI tools?
|
||
### Namespaces | ||
* We generally recommend using the [.NET Core CLI tools](xref:core/miscellaneous/cli/dotnet), which work on all platforms. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, I think we should start recommending them.
I don't think most applications will hit the idempotent script issues, but if you want to list them:
|
Sounds good. I think I had them there because that's how PMC tab-completes
No. But I think there's a community PR out that adds them.
I'd be fine with hosting them in our docs. How much do they build off the previous ASP.NET tutorials? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
...with changes for consideration
dotnet ef migrations add AddNewTables --idempotent | ||
``` | ||
|
||
#### [Visual Studio](#tab/vs) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should something go here about accessing the Package Management Console, for the context of where these commands are run from?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You mean general information on the PMC and how to install the tools, right? If so, we have the dedicated page on that, and there's the "install the tools" paragraph (with a link to the dedicated page) in the migration's index.html. Do you think we need something more?
|
||
For more information on applying migrations via the command-line tools, see the [EF Core tools reference](xref:core/miscellaneous/cli/index). | ||
|
||
## Apply migrations at runtime |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there guidance on how to create a standalone executable for this that would be an interim solution until the new bundling features are ready? It seems some companies will build a console app just to host the migrations code and deploy that to run as part of CI/CD separate from the web app consuming the database.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not specifically aware of people going to those lengths (but maybe @bricelam is)... Typically people either deploy via SQL scripts (which is what we usually recommend), or they just stick Migrate in their program startup, which is what we try to discourage...
I guess that since @bricelam is specifically working on bundles, we may want to hold off for now and just document that once it lands...
|
||
### Namespaces | ||
* We generally recommend using the [.NET Core CLI tools](xref:core/miscellaneous/cli/dotnet), which work on all platforms. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also, "which works"
Have made the changes here, @bricelam in particular I've redone the tutorial to show |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I just love this organization--much easier to grok.
dotnet ef database update
,Migrate()
(and its pitfalls), etc. This is where we compare the different deployment strategies etc.Closes #814
Closes #694
Closes #2369
Closes #2188
Closes #1048
Part of #691