diff --git a/CHANGELOG.md b/CHANGELOG.md index bcb4afce0..b4b00a468 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,11 @@ and releases in Discovery project adheres to [Semantic Versioning](http://semver ## [Unreleased] +## [3.5.7] - 2021-01-15 + +### Fixed +- symphony_nightly migration foreign key error [2142](https://github.com/ualbertalib/discovery/issues/2142) + ## [3.5.6] - 2021-01-05 ### Changed diff --git a/config/application.rb b/config/application.rb index dffefc657..a4b4e5bde 100755 --- a/config/application.rb +++ b/config/application.rb @@ -8,7 +8,7 @@ Bundler.require(*Rails.groups) module Discovery - VERSION = '3.5.6'.freeze # used in application layout meta generator tag + VERSION = '3.5.7'.freeze # used in application layout meta generator tag class Application < Rails::Application # Settings in config/environments/* take precedence over those specified here. diff --git a/docker-compose.lightweight.yml b/docker-compose.lightweight.yml index 1830fcaec..72ebe0175 100644 --- a/docker-compose.lightweight.yml +++ b/docker-compose.lightweight.yml @@ -12,7 +12,7 @@ volumes: services: mysql: - image: mysql:5.7 + image: mysql:5.5 # matches staging/production environment: MYSQL_ROOT_PASSWORD: mysecretpassword volumes: diff --git a/lib/generators/symphony_nightly/templates/update_symphony_nightly.erb b/lib/generators/symphony_nightly/templates/update_symphony_nightly.erb index eab5d17c5..7c633f313 100644 --- a/lib/generators/symphony_nightly/templates/update_symphony_nightly.erb +++ b/lib/generators/symphony_nightly/templates/update_symphony_nightly.erb @@ -16,8 +16,8 @@ class UpdateSymphonyNightly<%= Time.now.strftime('%Y%m%d') %> < ActiveRecord::Mi # Creating the locations table later on without this gives errors that were # difficult to to make sense of. foreign_keys('backup_locations').each do |fkey| + remove_foreign_key fkey.from_table, column: fkey.options[:column] rename_column fkey.from_table, fkey.options[:column], 'backup_' + fkey.options[:column] - remove_foreign_key fkey.from_table, fkey.to_table add_foreign_key fkey.from_table, fkey.to_table end @@ -56,8 +56,8 @@ class UpdateSymphonyNightly<%= Time.now.strftime('%Y%m%d') %> < ActiveRecord::Mi end foreign_keys('locations').each do |fkey| + remove_foreign_key fkey.from_table, column: fkey.options[:column] rename_column fkey.from_table, fkey.options[:column], fkey.options[:column].gsub('backup_', '') - remove_foreign_key fkey.from_table, fkey.to_table add_foreign_key fkey.from_table, fkey.to_table end