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

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

  DOWNTIME = false

  def up
    with_lock_retries do
      create_table :project_compliance_framework_settings, id: false do |t|
        t.references :project, primary_key: true, null: false, index: true, foreign_key: { on_delete: :cascade }
        t.integer :framework, null: false, limit: 2
      end
    end
  end

  def down
    with_lock_retries do
      drop_table :project_compliance_framework_settings
    end
  end
end