BigW Consortium Gitlab

20140313092127_migrate_already_imported_projects.rb 527 Bytes
Newer Older
1
# rubocop:disable all
2
class MigrateAlreadyImportedProjects < ActiveRecord::Migration
3 4
  include Gitlab::Database

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

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