Add rule_type to approval_project_rules
Adds migration to introduce non-regular rule_types to approval_project_rules
This commit is contained in:
parent
2860cfaaff
commit
1b9dbef3fd
4 changed files with 41 additions and 0 deletions
|
@ -0,0 +1,5 @@
|
|||
---
|
||||
title: Add migration for adding rule_type to approval_project_rules
|
||||
merge_request: 30575
|
||||
author:
|
||||
type: added
|
|
@ -0,0 +1,17 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class AddRuleTypeToApprovalProjectRules < ActiveRecord::Migration[5.1]
|
||||
include Gitlab::Database::MigrationHelpers
|
||||
|
||||
DOWNTIME = false
|
||||
|
||||
disable_ddl_transaction!
|
||||
|
||||
def up
|
||||
add_column_with_default :approval_project_rules, :rule_type, :integer, limit: 2, default: 0, allow_null: false
|
||||
end
|
||||
|
||||
def down
|
||||
remove_column :approval_project_rules, :rule_type
|
||||
end
|
||||
end
|
|
@ -0,0 +1,17 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class AddIndexToApprovalProjectRulesRuleType < ActiveRecord::Migration[5.1]
|
||||
include Gitlab::Database::MigrationHelpers
|
||||
|
||||
DOWNTIME = false
|
||||
|
||||
disable_ddl_transaction!
|
||||
|
||||
def up
|
||||
add_concurrent_index :approval_project_rules, :rule_type
|
||||
end
|
||||
|
||||
def down
|
||||
remove_concurrent_index :approval_project_rules, :rule_type
|
||||
end
|
||||
end
|
|
@ -282,7 +282,9 @@ ActiveRecord::Schema.define(version: 2019_07_15_114644) do
|
|||
t.integer "project_id", null: false
|
||||
t.integer "approvals_required", limit: 2, default: 0, null: false
|
||||
t.string "name", null: false
|
||||
t.integer "rule_type", limit: 2, default: 0, null: false
|
||||
t.index ["project_id"], name: "index_approval_project_rules_on_project_id", using: :btree
|
||||
t.index ["rule_type"], name: "index_approval_project_rules_on_rule_type", using: :btree
|
||||
end
|
||||
|
||||
create_table "approval_project_rules_groups", force: :cascade do |t|
|
||||
|
|
Loading…
Reference in a new issue