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

20160805041956_add_deleted_at_to_namespaces.rb « migrate « db - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 404c253e18bfa53dbad2f2cba716cfa4c1f27094 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
# rubocop:disable Migration/Datetime
# rubocop:disable RemoveIndex
class AddDeletedAtToNamespaces < ActiveRecord::Migration
  include Gitlab::Database::MigrationHelpers

  DOWNTIME = false

  disable_ddl_transaction!

  def up
    add_column :namespaces, :deleted_at, :datetime

    add_concurrent_index :namespaces, :deleted_at
  end

  def down
    remove_index :namespaces, :deleted_at if index_exists? :namespaces, :deleted_at

    remove_column :namespaces, :deleted_at
  end
end