diff options
author | sue445 <sue445@sue445.net> | 2019-05-16 17:19:17 +0900 |
---|---|---|
committer | sue445 <sue445@sue445.net> | 2019-05-16 18:58:56 +0900 |
commit | 9618141dc73ce24da521e2305eed613889879d73 (patch) | |
tree | 2bb718076e8f97f81b83f136451259ec624cab9d /db | |
parent | e8fe08fca2277b77f6e42a59ac8946b6cb9db098 (diff) | |
download | gitlab-ce-9618141dc73ce24da521e2305eed613889879d73.tar.gz |
Fix. db:migrate is failed on MySQL 8
```
StandardError: An error has occurred, all later migrations canceled:
Mysql2::Error: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'system = true AND note LIKE '\_%\_'' at line 1: UPDATE notes SET note = trim(both '_' from note) WHERE system = true AND note LIKE '\_%\_'
```
Diffstat (limited to 'db')
-rw-r--r-- | db/migrate/20150509180749_convert_legacy_reference_notes.rb | 3 |
1 files changed, 2 insertions, 1 deletions
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 |