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

13 lines
414 B
Ruby
Raw Normal View History

2014-09-02 18:07:02 +05:30
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