Foreign key name is too long

Foreign key name is too long

Postby hcro12 » Tue 03 Mar 2015 12:14

When I run a ctxt.CreateDatabase(false, true), I got "Identifier name 'FK_omse_networkelements_Omse_Networkelement_Lnk_Omse_NetworkElements' is too long".

SQL statement from dbMonitor:

Code: Select all
CREATE TABLE omse_networkelements (
   NetworkElement_Id INT(11) AUTO_INCREMENT NOT NULL,
   NetworkElement_XtranId INT(11),
   NetworkElement_Number INT(11) NOT NULL,
   NetworkElement_Name LONGTEXT NOT NULL,
   NetworkElement_TimeStamp VARCHAR(50),
   lnk_Omse_NetworkElement_Types INT(11) NOT NULL,
   lnk_Omse_NetworkElements INT(11),
   lnk_Omse_Components INT(11),
   CONSTRAINT PK_omse_networkelements PRIMARY KEY (NetworkElement_Id),
   CONSTRAINT FK_omse_networkelements_Omse_Component FOREIGN KEY (lnk_Omse_Components) REFERENCES omse_components (Comp_Id) ON DELETE NO ACTION,
   CONSTRAINT FK_omse_networkelements_Omse_Networkelement_Lnk_Omse_NetworkElements FOREIGN KEY (lnk_Omse_NetworkElements) REFERENCES omse_networkelements (NetworkElement_Id) ON DELETE NO ACTION,
   CONSTRAINT FK_omse_networkelements_Omse_Networkelement_Type FOREIGN KEY (lnk_Omse_NetworkElement_Types) REFERENCES omse_networkelement_types (NetworkElement_Type_Id) ON DELETE NO ACTION
)
ENGINE = INNODB


I have included in my config file:

Code: Select all
  <Devart.Data.MySql.Entity>
    <CodeFirstOptions TruncateLongDefaultNames="true" />
  </Devart.Data.MySql.Entity>


But no luck :(

Any tips?
hcro12
 
Posts: 8
Joined: Tue 03 Mar 2015 06:11

Re: Foreign key name is too long

Postby MariiaI » Tue 03 Mar 2015 12:28

We have asked you for the additional information here.
MariiaI
Devart Team
 
Posts: 1472
Joined: Mon 13 Feb 2012 08:17


Return to dotConnect for MySQL