debian-mirror-gitlab/db/migrate/20150509180749_convert_legacy_reference_notes.rb

18 lines
533 B
Ruby
Raw Normal View History

2015-09-11 14:41:01 +05:30
# Convert legacy Markdown-emphasized notes to the current, non-emphasized format
#
# _mentioned in 54f7727c850972f0401c1312a7c4a6a380de5666_
#
# becomes
#
# mentioned in 54f7727c850972f0401c1312a7c4a6a380de5666
2019-02-15 15:39:39 +05:30
class ConvertLegacyReferenceNotes < ActiveRecord::Migration[4.2]
2015-09-11 14:41:01 +05:30
def up
2019-09-04 21:01:54 +05:30
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 '\_%\_'}
2015-09-11 14:41:01 +05:30
end
def down
# noop
end
end