debian-mirror-gitlab/db/migrate/20140313092127_migrate_already_imported_projects.rb

16 lines
545 B
Ruby
Raw Normal View History

# rubocop:disable all
2014-09-02 18:07:02 +05:30
class MigrateAlreadyImportedProjects < ActiveRecord::Migration
2017-08-17 22:00:37 +05:30
include Gitlab::Database::MigrationHelpers
2016-06-02 11:05:42 +05:30
2014-09-02 18:07:02 +05:30
def up
2016-06-02 11:05:42 +05:30
execute("UPDATE projects SET import_status = 'finished' WHERE imported = #{true_value}")
execute("UPDATE projects SET import_status = 'none' WHERE imported = #{false_value}")
2014-09-02 18:07:02 +05:30
remove_column :projects, :imported
end
def down
add_column :projects, :imported, :boolean, default: false
2016-06-02 11:05:42 +05:30
execute("UPDATE projects SET imported = #{true_value} WHERE import_status = 'finished'")
2014-09-02 18:07:02 +05:30
end
end