Skip to content
This repository has been archived by the owner on Dec 22, 2022. It is now read-only.

Symphony nightly migration foreign key error #2143

Merged
merged 2 commits into from
Jan 18, 2021
Merged

Symphony nightly migration foreign key error #2143

merged 2 commits into from
Jan 18, 2021

Conversation

pgwillia
Copy link
Member

Context

We're trying to automate data flowing from Symphony configuration files to Discovery to provide user better labels in the holdings table.

When we tried the two steps (rails g symphony_nightly rake db:migrate) in staging/production we encountered a failure in the migration and complains about foreign key constraints. There was a bug in the migration template that was hidden in development/test because a different, more tolerant version of MySQL was being used (5.7 vs 5.5 in production)

Related to #2142

What's New

  • fixed symphony_nightly migration foreign key error
  • bump version for new release

When I try to rename the library_id column to backup_library_id a foreign key constraint is broken. The bug was hidden using MySQL 5.7 but not in MySQL 5.5 which is used by staging and production.

By first removing the foreign key constraint then renaming the column and finally restoring the foreign key there aren't any invalid constriants at any time.
@pgwillia pgwillia merged commit 695dc43 into ualbertalib:master Jan 18, 2021
@pgwillia pgwillia deleted the symphony_nightly_migration_foreign_key_error branch January 18, 2021 22:20
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants