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
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion config/application.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion docker-compose.lightweight.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ volumes:

services:
mysql:
image: mysql:5.7
image: mysql:5.5 # matches staging/production
environment:
MYSQL_ROOT_PASSWORD: mysecretpassword
volumes:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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

Expand Down