Commit 10241507 authored by Mayra Cabrera's avatar Mayra Cabrera

Merge branch '9928ee-add-rule_type-to-approval-project-rules' into 'master'

Add migration for adding rule_type to approval_project_rules

See merge request gitlab-org/gitlab-ce!30575
parents 2860cfaa 1b9dbef3
---
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
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|
......
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