I have been doing some proof of concept work which includes checking Entity Framework 6 over SQL Anywhere 16.
Everything has been working fine and I can do almost everything I need. However, I have come across an issue that I am unable to get around and have been unsuccessful in finding any information on my problem.
When using MSSQL as a database, my code first migrations work just fine. I can alter my model properties, scaffold a new migration and apply it to my database. The __MigrationHistory table is updated to reflect the changes and everything is working.
When using SQLA16, I can scaffold the migration and update the table with the new fields but the __MigrationHistory is not written. This leaves EF thinking the changes have not yet been applied but the database won't accept the migration as the fields already exist.
Is anyone aware of any reasons why this might be the case or does the provider i'm using (188.8.131.5244) not fully support EF6 over SQLA16.
Thanks in advance.
I passed your question by one of our .Net developers and got this response:
The migration was introduced in EF4.x. We support it in the EF4.x/5.x provider. But our EF6 provider doesn’t support it any more. We found that migration is not reliable. It can’t be fully tested and it is not really required. If you change to the code first model, you can always runs simple code to re-create the database schema. Microsoft claims the benefit of Migration is that it allows the user to switch back and forth. I don’t believe that’s needed for real application development. It may be cool for demonstrations but if users really want to keep multiple versions of the data model, it is better to manage that externally (instead of using EF migration).
answered 05 Feb '16, 14:46
Hi, I am trying to use Code First EF6 Migration to add a column to my SQLA16 database, but I am getting the following error when I call Update-Database from the NuGet Console in VS2013:
No MigrationSqlGenerator found for provider 'iAnywhere.Data.SQLAnywhere'. Use the SetSqlGenerator method in the target migrations configuration class to register additional SQL generators.
How to sole this?
Thanks in advance,
answered 17 Apr '16, 09:01