summaryrefslogtreecommitdiff
path: root/db/migrate/20201118093135_create_namespace_onboarding_actions.rb
blob: 6b38a0dddca953967f82c2faa9f6128be4083fa9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
# frozen_string_literal: true

class CreateNamespaceOnboardingActions < ActiveRecord::Migration[6.0]
  include Gitlab::Database::MigrationHelpers

  DOWNTIME = false

  def up
    with_lock_retries do
      create_table :namespace_onboarding_actions do |t|
        t.references :namespace, index: true, null: false, foreign_key: { on_delete: :cascade }
        t.datetime_with_timezone :created_at, null: false
        t.integer :action, limit: 2, null: false
      end
    end
  end

  def down
    with_lock_retries do
      drop_table :namespace_onboarding_actions
    end
  end
end