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

Commit

Permalink
Merge pull request #2143 from pgwillia/symphony_nightly_migration_for…
Browse files Browse the repository at this point in the history
…eign_key_error

Symphony nightly migration foreign key error
  • Loading branch information
pgwillia authored Jan 18, 2021
2 parents 1eca31f + 0d71270 commit 695dc43
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 4 deletions.
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

0 comments on commit 695dc43

Please sign in to comment.