diff options
author | Stan Hu <stanhu@gmail.com> | 2019-05-16 13:43:56 +0000 |
---|---|---|
committer | Stan Hu <stanhu@gmail.com> | 2019-05-16 13:43:56 +0000 |
commit | 542b2a7e356272cfdc3037b788d7e15b2f8739ac (patch) | |
tree | 53a96440d77ad41a17639f9bcffff50ba6ac85cb | |
parent | 167b7641a56804f819c01d04818c5b8d8269aa6d (diff) | |
parent | 9618141dc73ce24da521e2305eed613889879d73 (diff) | |
download | gitlab-ce-542b2a7e356272cfdc3037b788d7e15b2f8739ac.tar.gz |
Merge branch 'fix_failure_migrate_on_mysql8' into 'master'
Fix. db:migrate is failed on MySQL 8
See merge request gitlab-org/gitlab-ce!28351
-rw-r--r-- | changelogs/unreleased/fix-db-migrate-is-failed-on-mysql8.yml | 5 | ||||
-rw-r--r-- | db/migrate/20150509180749_convert_legacy_reference_notes.rb | 3 |
2 files changed, 7 insertions, 1 deletions
diff --git a/changelogs/unreleased/fix-db-migrate-is-failed-on-mysql8.yml b/changelogs/unreleased/fix-db-migrate-is-failed-on-mysql8.yml new file mode 100644 index 00000000000..63f134808e3 --- /dev/null +++ b/changelogs/unreleased/fix-db-migrate-is-failed-on-mysql8.yml @@ -0,0 +1,5 @@ +--- +title: Fix. `db:migrate` is failed on MySQL 8 +merge_request: 28351 +author: sue445 +type: fixed diff --git a/db/migrate/20150509180749_convert_legacy_reference_notes.rb b/db/migrate/20150509180749_convert_legacy_reference_notes.rb index a44a908c2f5..84d4eb9e51f 100644 --- a/db/migrate/20150509180749_convert_legacy_reference_notes.rb +++ b/db/migrate/20150509180749_convert_legacy_reference_notes.rb @@ -7,7 +7,8 @@ # mentioned in 54f7727c850972f0401c1312a7c4a6a380de5666 class ConvertLegacyReferenceNotes < ActiveRecord::Migration[4.2] def up - execute %q{UPDATE notes SET note = trim(both '_' from note) WHERE system = true AND note LIKE '\_%\_'} + quoted_column_name = ActiveRecord::Base.connection.quote_column_name('system') + execute %Q{UPDATE notes SET note = trim(both '_' from note) WHERE #{quoted_column_name} = true AND note LIKE '\_%\_'} end def down |