summaryrefslogtreecommitdiff
path: root/db/post_migrate/20191202031812_drop_operations_feature_flags_clients_token.rb
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2019-12-04 21:07:31 +0000
committerGitLab Bot <gitlab-bot@gitlab.com>2019-12-04 21:07:31 +0000
commit71221554dd9ddf30f73035c89f78164e001aa96d (patch)
treec56e0b2fc3dd16602183b78cb3f68aed211c5e77 /db/post_migrate/20191202031812_drop_operations_feature_flags_clients_token.rb
parentb41cd8cb92d53454b2b160ba922d33801933a9cf (diff)
downloadgitlab-ce-71221554dd9ddf30f73035c89f78164e001aa96d.tar.gz
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'db/post_migrate/20191202031812_drop_operations_feature_flags_clients_token.rb')
-rw-r--r--db/post_migrate/20191202031812_drop_operations_feature_flags_clients_token.rb23
1 files changed, 23 insertions, 0 deletions
diff --git a/db/post_migrate/20191202031812_drop_operations_feature_flags_clients_token.rb b/db/post_migrate/20191202031812_drop_operations_feature_flags_clients_token.rb
new file mode 100644
index 00000000000..bda461af7bc
--- /dev/null
+++ b/db/post_migrate/20191202031812_drop_operations_feature_flags_clients_token.rb
@@ -0,0 +1,23 @@
+# frozen_string_literal: true
+
+class DropOperationsFeatureFlagsClientsToken < ActiveRecord::Migration[5.2]
+ include Gitlab::Database::MigrationHelpers
+
+ DOWNTIME = false
+
+ disable_ddl_transaction!
+
+ def up
+ # Ignored in 12.5 - https://gitlab.com/gitlab-org/gitlab/merge_requests/18923
+ remove_column :operations_feature_flags_clients, :token
+ end
+
+ def down
+ unless column_exists?(:operations_feature_flags_clients, :token)
+ add_column :operations_feature_flags_clients, :token, :string # rubocop:disable Migration/AddLimitToStringColumns
+ end
+
+ add_concurrent_index :operations_feature_flags_clients, [:project_id, :token], unique: true,
+ name: 'index_operations_feature_flags_clients_on_project_id_and_token'
+ end
+end