Skip to Main Content

ODP.NET

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Code First Migrations with ODAC 12c R3 Beta

stiefelOct 21 2014 — edited Feb 12 2015

Hello,

I am trying to get Code First Migrations working with Entity Framework 6 and ODAC 12c R3 Beta.

Everything seems to be ok when working with Package-Manager-Console.

I can enable migrations, add code based migrations and update them to my Oracle Database.

But I can't switch to another empty schema and apply my migrations there from code.

I do it the same way as I succeeded with MSSQL and MySql.

I am working with MigrateDatabaseToLatestVersion - Initializer and I call Database.CreateIfNotExists() on first DB-Access. This way, by launching my application, I get my MSSQL- and MySQL-Databases up to date and even created when not existing.

On Oracle I get the following Exception:

'Unable to complete operation. The supplied SqlConnection does not specify an initial catalog or AttachDBFileName.'

I even get this exception when connection to the Database that got already updated by Package-Manager-Console and is already up to date.

As you can guess from the Exception Text, it is thrown by the SqlServer-Provider (EntityFramework.SqlServer).

Of course I have the right provider configured in my app.config

<provider invariantName="Oracle.DataAccess.Client" type="Oracle.DataAccess.EntityFramework.EFOracleProviderServices, Oracle.DataAccess.EntityFramework, Version=6.121.1.0, Culture=neutral, PublicKeyToken=89b483f429c47342" />

and my ConnectionString looks valid, too...

<add name="..." providerName="Oracle.DataAccess.Client" .../>

So why is the SqlProvider going to be used? Thanks for your help.

This post has been answered by Alex Keh-Oracle on Oct 30 2014
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Mar 12 2015
Added on Oct 21 2014
10 comments
3,292 views