Commit 1b9dbef3 authored by Lucas Charles's avatar Lucas Charles Committed by Mayra Cabrera

Add rule_type to approval_project_rules

Adds migration to introduce non-regular rule_types to
approval_project_rules
parent 2860cfaa
---
title: Add migration for adding rule_type to approval_project_rules
merge_request: 30575
author:
type: added
# 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
# 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 ...@@ -282,7 +282,9 @@ ActiveRecord::Schema.define(version: 2019_07_15_114644) do
t.integer "project_id", null: false t.integer "project_id", null: false
t.integer "approvals_required", limit: 2, default: 0, null: false t.integer "approvals_required", limit: 2, default: 0, null: false
t.string "name", 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 ["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 end
create_table "approval_project_rules_groups", force: :cascade do |t| create_table "approval_project_rules_groups", force: :cascade do |t|
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment