98bb435f42
Migrations shouldn't fail RuboCop checks - especially lint checks, such as the nested method check. To avoid changing code in existing migrations, add the magic comment to the top of each of them to skip that file.
15 lines
527 B
Ruby
15 lines
527 B
Ruby
# rubocop:disable all
|
|
class MigrateAlreadyImportedProjects < ActiveRecord::Migration
|
|
include Gitlab::Database
|
|
|
|
def up
|
|
execute("UPDATE projects SET import_status = 'finished' WHERE imported = #{true_value}")
|
|
execute("UPDATE projects SET import_status = 'none' WHERE imported = #{false_value}")
|
|
remove_column :projects, :imported
|
|
end
|
|
|
|
def down
|
|
add_column :projects, :imported, :boolean, default: false
|
|
execute("UPDATE projects SET imported = #{true_value} WHERE import_status = 'finished'")
|
|
end
|
|
end
|