Skip to content
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

[Tools] [Enhancement] Extend dotnet ef scripting #10393

Closed
joacar opened this issue Nov 24, 2017 · 3 comments
Closed

[Tools] [Enhancement] Extend dotnet ef scripting #10393

joacar opened this issue Nov 24, 2017 · 3 comments

Comments

@joacar
Copy link

joacar commented Nov 24, 2017

Hi,

I would like to see some extension to the scripting via command line (or PMC for that matter)

dotnet ef migrations revert

  1. Update the database to the previous migrations and apply it dotnet ef database update Migrations-1
  2. Remove the last not applied migrations dotnet ef migrations remove

File extension for additional data

In many of my web projects the DbContext is definied in an assembly different from where the app is hosted, so I tend to write dotnet ef migrations add MyMigration -c MyContext -p ... -o ... very frequently. This is now a custom script, which works fine. I can just dotnetef migrations add MyMigration.
For new people this is something that they would need to learn and get acustom to, and I want it to be as simple as possible to get started and just do "the normal way": dotnet ef migrations add MyMigration.

Perhaps this can be fixed by a file with configurations that can be read (if exists). For example

.ef.config

MyContext: -p ... -o ...
MyOtherContext: -p ... -o ...

dotnet ef migrations squash

If working on a feature branch this would be very useful to creata a single migration from many experimental. Currently I do the "revert" step over and over again.

A lot of stuff here and I will gladly help submitting a PR if someone could point me in the direction where to start; if this is something that the community would like to see.

Otherwise point me in the right direction anyway so that perhaps I can build it as an extension :)

Good work with EF

@bricelam
Copy link
Contributor

Some thoughts:

#1972 is about adding a --revert option (or similar) to dotnet ef migrations remove

I think we support response files (or can easily enable it):

dotnet ef migrations add @MyContext.ef.config

#2174 is tracking a squash command.

@ajcvickers
Copy link
Member

@joacar Thanks for the suggestions. As @bricelam says above, two of these issues are already being tracked, and I just filed #10409 for ensuring the response files can be used. We would be happy to help you get started if you would like to work on a PR for any of these issues.

@joacar
Copy link
Author

joacar commented Nov 28, 2017

@ajcvickers I would be glad to contribute! Perhaps response files I a good starting point and after completion move to tackling the others. I'll move the discussion to the appropriate issue!

@ajcvickers ajcvickers reopened this Oct 16, 2022
@ajcvickers ajcvickers closed this as not planned Won't fix, can't repro, duplicate, stale Oct 16, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants