We just licensed ASP.NET Zero for a new project and configured it to use a MySQL db as documented but when trying to run the existing migrations that ship with the project either using the Migrator project, package manager console or the dotnet cli (with the ef addon) we get errors that the syntax and data types being used on the existing migrations is not compatible with MySQL since they seem to have been coded for SQL Server. Examples: datetime2, nvarchar(max), varbinary(max) to name a few.
Is there an easier way other than modifying all of those migrations to be MySQL compatible to get the initial set of entities, indexes, etc created for a project?
5 Answer(s)
-
0
Hi @Abaco,
I suggest you delete all migrations and create an initial migration for MySQL.
-
0
-
0
Ok, I missed one important piece of information from the instructions:
Remove all migration classes (including DbContextModelSnapshot) under *.EntityFrameworkCore/Migrations folder;
-
0
Hello there. We noticed after doing this even though it worked to create the initial migration and update the database correctly, when we run add-migration to create a new one with changes we're doing to the model, the new migration gets created with all of the same structures that the initial migration already created causing duplication errors. Any ideas why it's not doing the "diff" to create only the new changes?
-
0
Hi @Abaco,
Could you share your project with [email protected]