debian-mirror-gitlab/db/migrate/20160805041956_add_deleted_at_to_namespaces.rb

22 lines
490 B
Ruby
Raw Normal View History

2017-09-10 17:25:29 +05:30
# rubocop:disable Migration/Datetime
2017-08-17 22:00:37 +05:30
# rubocop:disable RemoveIndex
2019-02-15 15:39:39 +05:30
class AddDeletedAtToNamespaces < ActiveRecord::Migration[4.2]
2016-09-13 17:45:13 +05:30
include Gitlab::Database::MigrationHelpers
DOWNTIME = false
disable_ddl_transaction!
2017-08-17 22:00:37 +05:30
def up
2016-09-13 17:45:13 +05:30
add_column :namespaces, :deleted_at, :datetime
2017-08-17 22:00:37 +05:30
2016-09-13 17:45:13 +05:30
add_concurrent_index :namespaces, :deleted_at
end
2017-08-17 22:00:37 +05:30
def down
remove_index :namespaces, :deleted_at if index_exists? :namespaces, :deleted_at
remove_column :namespaces, :deleted_at
end
2016-09-13 17:45:13 +05:30
end