0

The EF Core migration commands are:

  add     Adds a new migration.
  list    Lists available migrations.
  remove  Removes the last migration.
  script  Generates a SQL script from migrations.

Is there any way to see the status of available migrations (whether they were run or not)? Something like a dotnet ef migrations status?

1
  • 2
    Not yet. See issue #577
    – bricelam
    Feb 12, 2019 at 21:15

2 Answers 2

0

Get-Migrations command will Displays the migrations that have been applied to the target database.

2
  • 4
    ...in EF6, but not EF Core.
    – bricelam
    Feb 12, 2019 at 21:16
  • 1
    Yep. I wrote it. ;-) It just lists all the available migrations, but doesn't say which ones have been applied to the database.
    – bricelam
    Feb 13, 2019 at 18:01
0

So the answer was NO for EF-versions < EF6.

To find out which commands are available run: ef dotnet migrations help, of which you can see the result in the question asked.

In doubt nothing prevents you to do a dumb work around and perform an 'update-database'-command to the latest version you require.

I guess since you can't "read" it to know, by (re-)imposing the migration you need, you can be sure as well.

I know, stupid suggestion. Please comment with creative ideas to get rid of this stupid suggestion.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.