Welcome to mirror list, hosted at ThFree Co, Russian Federation.

20140313092127_migrate_already_imported_projects.rb « migrate « db - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: f4392c0f05e8db595c9cd3524623d109b2c3dd52 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
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