You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cayenne.apache.org by "Andrus Adamchik (JIRA)" <ji...@apache.org> on 2017/02/09 01:32:41 UTC
[jira] [Created] (CAY-2222) MySQLAdapter should not create indexes
on FK columns
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)