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
Migrations: Using name with Script-Migration doesn't work (only ID) #6228
Comments
@warrior1305 is your model really empty as shown in the empty DbContext? If it isn't, can you provide it? |
I found solution of my problem: But for genering down scripts I should run: But this don't make me happy, because up scripts are not right: they duplicate sql code. There is my test project with generated migrations: |
Oops, I just commented on the wrong issue. Sorry, @warrior1305. |
This has regressed at some point. Both migration names and ids should be supported. This is particularly bad because PowerShell will expand the name, not the id. |
I use Entity Framework Core and PostgreSQL
project.json
Startup.cs
MyContext.cs
When I run command:
dotnet ef migrations script V038Migration V039Migration -o Migrations/Sql.Up/migration_v038_to_v039.sql
everything is okay: there are no errors. When command finished, it returns "Done".
But migration_v038_to_v039.sql is empty.
If I generate *.cs class with migration code - it is not empty (and it has code i expected)
But if I run next command:
dotnet ef migrations script V039Migration V038Migration -o Migrations/Sql.Down/migration_v039_to_v038.sql
then migration_v039_to_v038.sql will be not empty
The text was updated successfully, but these errors were encountered: