Code First Migrations - Empty migration classes
Code First Migrations - Empty migration classes
Why aren't my migrations being scaffolded like the are for SQL server? I mean, there are no best guesses as to what has changed... I just get a basic skelleton with the Up() and Down() methods
Am I missing something or is this not (yet) supported? Thanks!
Am I missing something or is this not (yet) supported? Thanks!
Our products support EF Code-First Migrations.
You can follow, for an example, this tutorial for the generation of migrations:
http://blogs.msdn.com/b/adonet/archive/ ... rough.aspx
Be aware that some additional settings should be implemented:
1. Add references to the Devart.Data.Oracle.Entity.dll and Devart.Data.Oracle.Entity.Migrations.dll assemblies to your project (these assemblies' names are for dotConnect for Oracle; other dotConnect providers include corresponding Devart.Data.Xxx.Entity.dll and Devart.Data.Xxx.Entity.Migrations.dll).
2. At first it is necessary to register SQL Generator in the constructor of the Configuration class which is a descendant of DbMigrationsConfiguration (it can be added to the user's project using the Enable-Migrations command in Package Manager Console):
The same for other dotConnect providers:
If you are working with dotConnect for Oracle, you should configure EF-provider for EF Code-First Migrations additionally (for example, it can be done in the constructor of your class-descendant of DbContext):
If you are working with dotConnect for MySQL (or PostgreSQL or SQLite), it is enough to turn on only IgnoreSchemaName:
You can follow, for an example, this tutorial for the generation of migrations:
http://blogs.msdn.com/b/adonet/archive/ ... rough.aspx
Be aware that some additional settings should be implemented:
1. Add references to the Devart.Data.Oracle.Entity.dll and Devart.Data.Oracle.Entity.Migrations.dll assemblies to your project (these assemblies' names are for dotConnect for Oracle; other dotConnect providers include corresponding Devart.Data.Xxx.Entity.dll and Devart.Data.Xxx.Entity.Migrations.dll).
2. At first it is necessary to register SQL Generator in the constructor of the Configuration class which is a descendant of DbMigrationsConfiguration (it can be added to the user's project using the Enable-Migrations command in Package Manager Console):
Code: Select all
SetSqlGenerator(OracleConnectionInfo.InvariantName, new OracleEntityMigrationSqlGenerator());
Code: Select all
SetSqlGenerator(MySqlConnectionInfo.InvariantName, new MySqlEntityMigrationSqlGenerator());
SetSqlGenerator(PgSqlConnectionInfo.InvariantName, new PgSqlEntityMigrationSqlGenerator());
SetSqlGenerator(SQLiteConnectionInfo.InvariantName, new SQLiteEntityMigrationSqlGenerator());
Code: Select all
var config = Devart.Data.Oracle.Entity.Configuration.OracleEntityProviderConfig.Instance;
config.Workarounds.IgnoreSchemaName = true;
config.Workarounds.ColumnTypeCasingConventionCompatibility = true;
Code: Select all
var config = Devart.Data.MySql.Entity.Configuration.MySqlEntityProviderConfig.Instance;
config.Workarounds.IgnoreSchemaName = true;
Re: Code First Migrations - Empty migration classes
Did you publish an article regarding this topic? If so maybe you could link to it..
Re: Code First Migrations - Empty migration classes
Here is a link to the corresponding article: http://blogs.devart.com/dotconnect/enti ... qlite.html.
The EF6-specific notes: http://blogs.devart.com/dotconnect/enti ... force.html.
The EF6-specific notes: http://blogs.devart.com/dotconnect/enti ... force.html.
Re: Code First Migrations - Empty migration classes
Shalex,
I implemented the sample from msdn for EF 4.3 and EF 5.0.
It works. But when I follow your steps I get many errors.
E.g. "Unable to find the requested .Net Framework Data Provider"
Do you have a full sample?
I implemented the sample from msdn for EF 4.3 and EF 5.0.
It works. But when I follow your steps I get many errors.
E.g. "Unable to find the requested .Net Framework Data Provider"
Do you have a full sample?
Re: Code First Migrations - Empty migration classes
This error should gone after registration of "Devart.Data.Oracle" in the DbProviderFactories section like you did in this post: http://forums.devart.com/viewtopic.php? ... 384#p96658.StefanAim wrote:"Unable to find the requested .Net Framework Data Provider"
We are working on the EF6-specific sample.StefanAim wrote:Do you have a full sample?
At the moment the following articles are available: