2016-06-16 23:09:34 +05:30
|
|
|
# rubocop:disable all
|
2019-01-03 12:48:30 +05:30
|
|
|
class AddServicesDefault < ActiveRecord::Migration
|
2016-01-29 22:53:50 +05:30
|
|
|
def up
|
|
|
|
add_column :services, :default, :boolean, default: false
|
|
|
|
|
|
|
|
default = quote_column_name('default')
|
|
|
|
type = quote_column_name('type')
|
|
|
|
|
|
|
|
execute <<-EOF
|
|
|
|
UPDATE services
|
|
|
|
SET #{default} = true
|
|
|
|
WHERE #{type} = 'GitlabIssueTrackerService'
|
|
|
|
EOF
|
|
|
|
|
|
|
|
add_index :services, :default
|
|
|
|
end
|
|
|
|
|
|
|
|
def down
|
|
|
|
remove_column :services, :default
|
|
|
|
end
|
|
|
|
end
|