-
Notifications
You must be signed in to change notification settings - Fork 3.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
Warn when using a newer version of dotnet ef with old runtime (command specific) #25153
Comments
Could you share a repro? If |
My fault. I found that it happens only if project uses older version of ef core. |
It didn't show the following warning?
Can you share a repro? |
Oh wait, that warning goes the other way. You were using newer tools with an older runtime, right? We should consider showing a warning for specific features that might not work. Another example would be the new compiled models command. |
Hi @bricelam, |
dotnet ef migrations list
to see the status Ef Core migrations?
Added an error for efcore/src/ef/Commands/MigrationsBundleCommand.cs Lines 39 to 42 in 302b246
We should add similar code to warn for |
I'm looking for the possibility to get the list of unapplied migrations in Ef Core.
I found the discussion about the same and it seems like it was implemented in Ef Core 5.0.
This however doesn't work for me.
Preconditions
The latest version of the tool is installed:
dotnet ef --version
Entity Framework Core .NET Command-line Tools
5.0.7
There is a project with migrations and
DbContextFactory
class that implementsIDesignTimeDbContextFactory<CoreContext>
interface to build theDbContext
. It is successfully picked up by the tool (dotnet ef database update
and other commands that required db connection work without issues).What I tried so far
dotnet ef migrations list --json
"applied" property is null for all migrations, however all of them are applied. (Operation fails in case if incorrect connection string passed to
CoreContext
fromDbContextFactory
).[
{
"id": "20210620081822_SomeMigration",
"name": "SomeMigration",
"safeName": "SomeMigration",
"applied": null
},
{
"id": "20210620083523_SomeOtherMigration",
"name": "SomeOtherMigration",
"safeName": "SomeOtherMigration",
"applied": null
}
]
dotnet ef migrations list --no-connect --json
Operation executed successfully (so option
--no-connect
which was added in scope of aforementioned PR does exist).Result is the same.
dotnet ef migrations list --no-connect false --json
Operation fails with the message:
Unrecognized command or argument 'false'.
Am I doing something wrong or is it a bug?
The text was updated successfully, but these errors were encountered: