oqtane / Oqtane.Survey

An Oqtane module that allows administrators to create user surveys. Oqtane allows developers to create external modules which are rendered by the framework dynamically at run-time.
MIT License
18 stars 7 forks source link

EF Core Migrations: Notify EF Core that the 1.0 migrations were already executed #9

Closed ADefWebserver closed 2 years ago

ADefWebserver commented 2 years ago

See this issue: https://github.com/oqtane/Oqtane.Survey/issues/8#issuecomment-1060890736

...if you have version 1.0 installed and then try to upgrade to Version 2.0 which is using Migrations, you need to notify EF Core that the 1.0 migrations were already executed. You do this by inserting a record in the Migrations History table. The Blog module had to deal with this scenario as well - so you can see an example here (see the Install method):

https://github.com/oqtane/oqtane.blogs/blob/master/Server/Manager/BlogManager.cs

ADefWebserver commented 2 years ago

Fixed with https://github.com/oqtane/Oqtane.Survey/commit/3cbe8b0960a3c72b1aba7c6294ee21902e14eeef