2016-06-09 08:39:16 -04:00
|
|
|
# rubocop:disable all
|
2014-03-13 05:28:41 -04:00
|
|
|
class MigrateAlreadyImportedProjects < ActiveRecord::Migration
|
2017-04-10 06:23:28 -04:00
|
|
|
include Gitlab::Database::MigrationHelpers
|
2016-04-10 09:22:58 -04:00
|
|
|
|
2014-03-13 05:28:41 -04:00
|
|
|
def up
|
2016-04-10 09:22:58 -04:00
|
|
|
execute("UPDATE projects SET import_status = 'finished' WHERE imported = #{true_value}")
|
|
|
|
execute("UPDATE projects SET import_status = 'none' WHERE imported = #{false_value}")
|
2014-03-13 05:28:41 -04:00
|
|
|
remove_column :projects, :imported
|
|
|
|
end
|
|
|
|
|
|
|
|
def down
|
|
|
|
add_column :projects, :imported, :boolean, default: false
|
2016-04-10 09:22:58 -04:00
|
|
|
execute("UPDATE projects SET imported = #{true_value} WHERE import_status = 'finished'")
|
2014-03-13 05:28:41 -04:00
|
|
|
end
|
|
|
|
end
|