summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndreas Brandl <abrandl@gitlab.com>2019-07-01 18:44:17 +0000
committerAndreas Brandl <abrandl@gitlab.com>2019-07-01 18:44:17 +0000
commit7177f59fe67ba00bb137fbf3d6f8636232640344 (patch)
treea8a03c2c6be1f45aeda21c496da3aedd07a79c05
parent9f38e22d68a327aea22b2f172db7d3fb70ba9ed2 (diff)
parent60576da88c2080e1529caff670cf0cb64c1bedcc (diff)
downloadgitlab-ce-7177f59fe67ba00bb137fbf3d6f8636232640344.tar.gz
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
-rw-r--r--changelogs/unreleased/add-strategies-column-to-scopes-table.yml5
-rw-r--r--db/migrate/20190628145246_add_strategies_to_operations_feature_flag_scopes.rb17
-rw-r--r--db/schema.rb3
3 files changed, 24 insertions, 1 deletions
diff --git a/changelogs/unreleased/add-strategies-column-to-scopes-table.yml b/changelogs/unreleased/add-strategies-column-to-scopes-table.yml
new file mode 100644
index 00000000000..0bb87fca014
--- /dev/null
+++ b/changelogs/unreleased/add-strategies-column-to-scopes-table.yml
@@ -0,0 +1,5 @@
+---
+title: Add strategies column to operations_feature_flag_scopes table
+merge_request: 29808
+author:
+type: other
diff --git a/db/migrate/20190628145246_add_strategies_to_operations_feature_flag_scopes.rb b/db/migrate/20190628145246_add_strategies_to_operations_feature_flag_scopes.rb
new file mode 100644
index 00000000000..ed1f16ee69a
--- /dev/null
+++ b/db/migrate/20190628145246_add_strategies_to_operations_feature_flag_scopes.rb
@@ -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
diff --git a/db/schema.rb b/db/schema.rb
index 50fee850f9f..8876be1cb34 100644
--- a/db/schema.rb
+++ b/db/schema.rb
@@ -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