cayenne-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Andrus Adamchik (JIRA)" <j...@apache.org>
Subject [jira] [Created] (CAY-2222) MySQLAdapter should not create indexes on FK columns
Date Thu, 09 Feb 2017 01:32:41 GMT
Andrus Adamchik created CAY-2222:
------------------------------------

             Summary: MySQLAdapter should not create indexes on FK columns
                 Key: CAY-2222
                 URL: https://issues.apache.org/jira/browse/CAY-2222
             Project: Cayenne
          Issue Type: Bug
            Reporter: Andrus Adamchik
            Assignee: Andrus Adamchik
            Priority: Minor
             Fix For: 4.0.M5


MySQLAdapter has this comment in the "createTableAppendPKClause" method:

// if FK constraints are supported, we must add indices to all FKs
// Note that according to MySQL docs, FK indexes are created
// automatically when constraint is defined, starting at MySQL 4.1.2

and then it proceeds to add indexe for all FKs.

This becomes a problem when a user wants to generate MySQL schema without FK constraints.
In which case those columns still end up having an index.

While we can refactor this in a backwards compatible manner, I think we can just drop support
for explicit index creation. After all MySQL 4.1.2 was released in 2004. 






--
This message was sent by Atlassian JIRA
(v6.3.15#6346)

Mime
View raw message