You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I tried using the same migration set for multiple database providers, and that worked out with .net core 2, and in .net core 3 and ef core 3, it does not work as it adds a .hasColumnType() to migration Design class for each migration, and the column type varies from database provider to another, which makes the migration fail when trying to apply it at a different database from the one it was used in the dbcontext when creating the migration.
Is there a way to use same migration set for different database providers in .net core 3, or this feature is no longer available?
In essence, yes. In theory you will still be able to do it, but the amount of code that will need to be conditional will increase. Also, when evolving this further we will be looking at improving the experience for parallel sets of migrations, rather than a single set with conditional code.
Moved from discussion 21688.
Question
From @hanidraidi
I tried using the same migration set for multiple database providers, and that worked out with .net core 2, and in .net core 3 and ef core 3, it does not work as it adds a .hasColumnType() to migration Design class for each migration, and the column type varies from database provider to another, which makes the migration fail when trying to apply it at a different database from the one it was used in the dbcontext when creating the migration.
Is there a way to use same migration set for different database providers in .net core 3, or this feature is no longer available?
Kind Regards,
Hani Draidi
Replies
From @ajcvickers
@hanidraidi See #16406
From @hanidraidi
@ajcvickers
So, Does this mean that one migration set for multiple database providers is no longer available with ef-core post-3.0?
From @ajcvickers
In essence, yes. In theory you will still be able to do it, but the amount of code that will need to be conditional will increase. Also, when evolving this further we will be looking at improving the experience for parallel sets of migrations, rather than a single set with conditional code.
From @hanidraidi
@ajcvickers
Many Thanks for the elaboration.
Kind Regards,
Hani
The text was updated successfully, but these errors were encountered: