Setting Package Manager console migration options

Discussion of open issues, suggestions and bugs regarding ADO.NET provider for Oracle
Post Reply
andyb0070
Posts: 1
Joined: Wed 10 Oct 2012 04:39

Setting Package Manager console migration options

Post by andyb0070 » Wed 10 Oct 2012 05:02

My environment is as follows:

Visual Studion 2010
Entity Framework 5
Devart DotConnect: 7.2.96.0
Oracle 11g

I'm attempting to upgrade my database using the Package Manger console command:

PM> Update-Database -Verbose -ConnectionStringName "SID1"

This references the app.config <connectionStrings> section to obtain the connection string. However, migration then throws an exception: "System.InvalidOperationException: Foreign key name 'FK_USERPROFILE_ADDRESS_ADDRESSID' in table USERPROFILE is too long (32 characters). An identifier with more than 30 characters was specified."

I see that I can set some options like "CodeFirstOptions.TruncateLongDefaultNames = True" but how would I do this when using the PM console?

Shalex
Site Admin
Posts: 9543
Joined: Thu 14 Aug 2008 12:44

Re: Setting Package Manager console migration options

Post by Shalex » Thu 11 Oct 2012 12:48

andyb0070 wrote:I see that I can set some options like "CodeFirstOptions.TruncateLongDefaultNames = True" but how would I do this when using the PM console?
Please set this option in the static constructor of your DbContext descendant and it will be taken into accout when you apply migrations via PM console.

Post Reply