I have this frustrating problem when trying to enable code migrations to create DB schema on azure MySql DB i got the:
[DbConfigurationType(typeof(MySqlEFConfiguration))]
specified to my data context and also
var configuration = new App.Migrations.Configuration();
var migrator = new DbMigrator(configuration);
migrator.Update();
but a simple Table that contains only ID property and a String doesnt seem to work on Azure, it says Table 'xxx' already exists, and when it doesnt it gives another error saying Specified key was too long; max key length is 767 bytes
whats wrong with the MySQL and Code First schema generation? thanks
Issue is likely...
I would recommend opening the Visual Studio 2015 SQL Server Object explorer and running a few queries on the tables in question or just see if those tables exist and what data is in them.
I also do not like code first migrations, for these sorts of reasons. I would recommend following this tutorial series.
https://channel9.msdn.com/Blogs/raw-tech/AI-Part-3-Entity-Framework-and-Unit-Tests
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.