Hi,
I just upgraded EF6 from Alpha 2 to Alpha 3, and devart oracle provider from 7.5.164.0 to 7.7.217.0. Everything worked fine in the Alpha 2 + dcoracle75pro environment. now I'm having issue with __MigrationHistory table owner. The sql script generated by Alpha 2 + dcoracle75pro is
CREATE TABLE "__MigrationHistory" (
"MigrationId" NVARCHAR2(255) NOT NULL,
"ContextKey" NVARCHAR2(512) NOT NULL,
"Model" BLOB NOT NULL,
"ProductVersion" NVARCHAR2(32) NOT NULL,
PRIMARY KEY ("MigrationId", "ContextKey")
)
which works great when the login name is the table owner name.
The sql script generated by Alpha 3 + dcoracle77pro is
CREATE TABLE "azteca"."__MigrationHistory" (
"MigrationId" NVARCHAR2(255) NOT NULL,
"ContextKey" NVARCHAR2(512) NOT NULL,
"Model" BLOB NOT NULL,
"ProductVersion" NVARCHAR2(32) NOT NULL,
PRIMARY KEY ("MigrationId", "ContextKey")
)
which produces ORA-01918: user 'azteca' does not exist error. However, the following two scripts would work.
CREATE TABLE azteca."__MigrationHistory" (
"MigrationId" NVARCHAR2(255) NOT NULL,
"ContextKey" NVARCHAR2(512) NOT NULL,
"Model" BLOB NOT NULL,
"ProductVersion" NVARCHAR2(32) NOT NULL,
PRIMARY KEY ("MigrationId", "ContextKey")
)
CREATE TABLE "AZTECA"."__MigrationHistory" (
"MigrationId" NVARCHAR2(255) NOT NULL,
"ContextKey" NVARCHAR2(512) NOT NULL,
"Model" BLOB NOT NULL,
"ProductVersion" NVARCHAR2(32) NOT NULL,
PRIMARY KEY ("MigrationId", "ContextKey")
)
I added modelBuilder.HasDefaultSchema("AZTECA"); that doesn't help.
please help?
EF6 Alpha 3 support
Re: EF6 Alpha 3 support
I tried to customize Code First Migrations History Table by following this post http://entityframework.codeplex.com/wik ... tomization
I got the following error message.
PM> update-database -verbose -targetmigration V20120100 -script
Using StartUp project 'Cityworks.DataAccess'.
Using NuGet project 'Cityworks.DataAccess'.
Target database is: '' (DataSource: 192.168.20.86, Provider: Devart.Data.Oracle, Origin: Configuration).
Migrating the history system table is only supported for move table operations. Ensure all other history table configuration happens as part of an initial explicit migration
Please help.
Thanks so much!
I got the following error message.
PM> update-database -verbose -targetmigration V20120100 -script
Using StartUp project 'Cityworks.DataAccess'.
Using NuGet project 'Cityworks.DataAccess'.
Target database is: '' (DataSource: 192.168.20.86, Provider: Devart.Data.Oracle, Origin: Configuration).
Migrating the history system table is only supported for move table operations. Ensure all other history table configuration happens as part of an initial explicit migration
Please help.
Thanks so much!
Re: EF6 Alpha 3 support
We cannot reproduce the problem at the moment. We have sent a test project to the e-mail which is specified in your profile on the forum.
Re: EF6 Alpha 3 support
Thank you for sending me the test project. There are several differences between your project and mine. It seems the only one that matters is the SetSqlGenerator command you have inside the Configuration constructor.
public Configuration()
{
AutomaticMigrationsEnabled = false;
this.SetSqlGenerator(OracleConnectionInfo.InvariantName,new OracleEntityMigrationSqlGenerator());
}
After I add this.SetSqlGenerator(OracleConnectionInfo.InvariantName,new OracleEntityMigrationSqlGenerator()); to my project, Everything starts to work correctly. I didn't have this line of code, but the project worked fine with EF6 alpha2 + dcoracle75pro.
There is one more issue that my project needs to work with both Sql Server and Oracle ( not at the same time). Since there is no DbContext here, how do I know when to set the generator for oracle or the one for sql server.
Thanks
JL
public Configuration()
{
AutomaticMigrationsEnabled = false;
this.SetSqlGenerator(OracleConnectionInfo.InvariantName,new OracleEntityMigrationSqlGenerator());
}
After I add this.SetSqlGenerator(OracleConnectionInfo.InvariantName,new OracleEntityMigrationSqlGenerator()); to my project, Everything starts to work correctly. I didn't have this line of code, but the project worked fine with EF6 alpha2 + dcoracle75pro.
There is one more issue that my project needs to work with both Sql Server and Oracle ( not at the same time). Since there is no DbContext here, how do I know when to set the generator for oracle or the one for sql server.
Thanks
JL
Re: EF6 Alpha 3 support
Actually, It's not an issue. We can define a sqlgenerator for oracle and another one for sql server side by side.
thanks
JL
thanks
JL
Re: EF6 Alpha 3 support
MigrationSqlGenerator for provider 'Devart.Data.Oracle' can be set either in code (in the Configuration() constructor) or in *.config (http://blogs.devart.com/dotconnect/enti ... force.html).