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

16 lines
527 B
Ruby
Raw Normal View History

# rubocop:disable all
2014-09-02 18:07:02 +05:30
class MigrateAlreadyImportedProjects < ActiveRecord::Migration
2016-06-02 11:05:42 +05:30
include Gitlab::Database
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