gitlab-org--gitlab-foss/db/migrate/20140313092127_migrate_already_imported_projects.rb
Dmitriy Zaporozhets 10c0cb8ca7
Add migration for already imported projects
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
2014-03-13 11:28:41 +02:00

12 lines
414 B
Ruby

class MigrateAlreadyImportedProjects < ActiveRecord::Migration
def up
Project.where(imported: true).update_all(import_status: "finished")
Project.where(imported: false).update_all(import_status: "none")
remove_column :projects, :imported
end
def down
add_column :projects, :imported, :boolean, default: false
Project.where(import_status: 'finished').update_all(imported: true)
end
end