Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Duplicate key name 'FK98293BFB217F5972' #148

Closed
jmiranda opened this issue May 18, 2016 · 1 comment
Closed

Duplicate key name 'FK98293BFB217F5972' #148

jmiranda opened this issue May 18, 2016 · 1 comment
Assignees
Labels
type: maintenance Code improvements, optimizations and refactors, dependency upgrades...
Milestone

Comments

@jmiranda
Copy link
Member

From Tan Li

I have the following errors when doing "grails run-app" under v.8.0 source code to start the app. Any suggestion?

ERROR context.GrailsContextLoader  - Error executing bootstraps: liquibase.exception.MigrationFailedException: Migration failed for change set 0.5.x/ad
d-product-synonyms.xml::1383077886142-3::jmiranda (generated):
     Reason: liquibase.exception.JDBCException: Error executing SQL CREATE INDEX `FK98293BFB217F5972` ON `openboxes_dev`.`synonym`(`created_by_id`):
          Caused By: Error executing SQL CREATE INDEX `FK98293BFB217F5972` ON `openboxes_dev`.`synonym`(`created_by_id`):
          Caused By: Duplicate key name 'FK98293BFB217F5972'
org.codehaus.groovy.runtime.InvokerInvocationException: liquibase.exception.MigrationFailedException: Migration failed for change set 0.5.x/add-product-synonyms.xml::1383077886142-3:
:jmiranda (generated):
     Reason: liquibase.exception.JDBCException: Error executing SQL CREATE INDEX `FK98293BFB217F5972` ON `openboxes_dev`.`synonym`(`created_by_id`):
          Caused By: Error executing SQL CREATE INDEX `FK98293BFB217F5972` ON `openboxes_dev`.`synonym`(`created_by_id`):
          Caused By: Duplicate key name 'FK98293BFB217F5972'
@jmiranda jmiranda added the type: bug Addresses unintended behaviours of the app label May 18, 2016
@jmiranda jmiranda added this to the 0.8.0 milestone May 18, 2016
@jmiranda jmiranda self-assigned this May 18, 2016
@jmiranda
Copy link
Member Author

This is caused because the index / foreign key constraint already exist (perhaps because the dbCreate attribute on the data source is set to "update", which would be bad).

We can guard against this by adding a preCondition to check if the index / foreign key constriant already exists, but until recently I was convinced that the foreignKeyConstraintExists precondition did not work in Liquibase 1.9.x. I seem to have been mistaken as it's been working for me over the past few weeks (maybe a MySQL version issue?).

@jmiranda jmiranda added type: maintenance Code improvements, optimizations and refactors, dependency upgrades... and removed type: bug Addresses unintended behaviours of the app labels May 18, 2016
@jmiranda jmiranda reopened this May 21, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: maintenance Code improvements, optimizations and refactors, dependency upgrades...
Projects
None yet
Development

No branches or pull requests

1 participant