Merge branch 'add-strategies-column-to-scopes-table' into 'master'

Add Migration for Strategies Column on operations_feature_flag_scopes

See merge request gitlab-org/gitlab-ce!29808
This commit is contained in:
Andreas Brandl 2019-07-01 18:44:17 +00:00
commit 7177f59fe6
3 changed files with 24 additions and 1 deletions

View File

@ -0,0 +1,5 @@
---
title: Add strategies column to operations_feature_flag_scopes table
merge_request: 29808
author:
type: other

View File

@ -0,0 +1,17 @@
# frozen_string_literal: true
class AddStrategiesToOperationsFeatureFlagScopes < ActiveRecord::Migration[5.1]
include Gitlab::Database::MigrationHelpers
DOWNTIME = false
disable_ddl_transaction!
def up
add_column_with_default :operations_feature_flag_scopes, :strategies, :jsonb, default: [{ name: "default", parameters: {} }]
end
def down
remove_column(:operations_feature_flag_scopes, :strategies)
end
end

View File

@ -10,7 +10,7 @@
#
# It's strongly recommended that you check this file into your version control system.
ActiveRecord::Schema.define(version: 20190627051902) do
ActiveRecord::Schema.define(version: 20190628145246) do
# These are extensions that must be enabled in order to support this database
enable_extension "plpgsql"
@ -2263,6 +2263,7 @@ ActiveRecord::Schema.define(version: 20190627051902) do
t.datetime_with_timezone "updated_at", null: false
t.boolean "active", null: false
t.string "environment_scope", default: "*", null: false
t.jsonb "strategies", default: [{"name"=>"default", "parameters"=>{}}], null: false
t.index ["feature_flag_id", "environment_scope"], name: "index_feature_flag_scopes_on_flag_id_and_environment_scope", unique: true, using: :btree
end