Foreign key name is too long

Discussion of open issues, suggestions and bugs regarding ADO.NET provider for MySQL
Post Reply
Korhojuh
Posts: 4
Joined: Wed 28 Jan 2015 10:50

Foreign key name is too long

Post by Korhojuh » Wed 28 Jan 2015 11:04

Hello,
I'm currently trying to port EF6 code first project from MSSQL to MySql and ran into problem where I get this error message:

Foreign key name 'FK_ClientApplicationControlAccesses_ClientApplicationControls_ClientApplicationControlId' in table ClientApplicationControlAccesses is too long (88 characters). An identifier with more than 64 characters was specified.


I didn't need to search for a long to find posts about how oracle and postgresql connectors have built in fucntion to truncate too long foreign keys. I searched a little more and found similiar feature in MySql connector, but I fail to get it working.

I put following lines to app.config of the project:

Code: Select all

<configuration>
    <Devart.Data.MySql.Entity>
        <CodeFirstOptions TruncateLongDefaultNames="true" />
    </Devart.Data.MySql.Entity>
</configuration>
What am I doing wrong or is there no such feature in the 8.3.333 MySql connecter?

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

Re: Foreign key name is too long

Post by Shalex » Thu 29 Jan 2015 15:20

We cannot reproduce the problem at the moment. We have just sent a test project to the email address specified in your forum profile. Please modify it for reproducing and send the project back to us.

Korhojuh
Posts: 4
Joined: Wed 28 Jan 2015 10:50

Re: Foreign key name is too long

Post by Korhojuh » Fri 30 Jan 2015 06:52

Hello,
As I was trying to reproduce the problem while jumping in between of the projects. I noticed that the NuGet command console was using wrong app.config. Nuget was using default project's app.config which did not have truncate option in it.

Phew. Such a simple mistake and a lot of headache from it.

Thanks for the working project. I was able to pin point problem to configs.

Post Reply