Bug #66355 | unable to add ef migration | ||
---|---|---|---|
Submitted: | 13 Aug 2012 15:56 | Modified: | 7 Sep 2012 22:02 |
Reporter: | luca morelli | Email Updates: | |
Status: | Not a Bug | Impact on me: | |
Category: | Connector / NET | Severity: | S2 (Serious) |
Version: | 6.6.1 | OS: | Windows (windows 7 64 bit) |
Assigned to: | Gabriela Martinez Sanchez | CPU Architecture: | Any |
Tags: | .net entity framework |
[13 Aug 2012 15:56]
luca morelli
[14 Aug 2012 17:20]
Gabriela Martinez Sanchez
Hi Luca, thanks for your bug report. In order to use the Migrations first you should create the Configuration class so EF can recognize our provider. The syntax to use for that is like this: //Include C/Net Namespace of Entity Framework using MySql.Data.Entity; internal sealed class Configuration : DbMigrationsConfiguration</*NameOfYourContext*/> { public Configuration() { AutomaticMigrationsEnabled = false; SetSqlGenerator("MySql.Data.MySqlClient", new MySql.Data.Entity.MySqlMigrationSqlGenerator()); } protected override void Seed(/*NameOfYourContext*/ context) { } } After adding this class you should be able to add Migrations to your database. Please let us know if after doing this you still have any problems.
[15 Aug 2012 8:30]
luca morelli
thank you very much: tried and it works. i would like to know if is possible to set the sqlgenerator via app.config or web.config file
[15 Aug 2012 15:03]
Gabriela Martinez Sanchez
Hi Luca, glad it worked. And no, the only way so far is creating the Configuration class. We'll be doing some tutorials later this week in case you want to check them later in our blog (blogs.oracle.com/MySqlOnWindows/) and you can post your questions in the forums too (forums.mysql.com/list.php?38).
[7 Sep 2012 22:02]
Gabriela Martinez Sanchez
Closing the bug since there is no other feedback or question from the user and it has been also responded as not a bug but a code error.