BigW Consortium Gitlab

20140313092127_migrate_already_imported_projects.rb 505 Bytes
Newer Older
1
class MigrateAlreadyImportedProjects < ActiveRecord::Migration
2 3
  include Gitlab::Database

4
  def up
5 6
    execute("UPDATE projects SET import_status = 'finished' WHERE imported = #{true_value}")
    execute("UPDATE projects SET import_status = 'none' WHERE imported = #{false_value}")
7 8 9 10 11
    remove_column :projects, :imported
  end

  def down
    add_column :projects, :imported, :boolean, default: false
12
    execute("UPDATE projects SET imported = #{true_value} WHERE import_status = 'finished'")
13 14
  end
end