summaryrefslogtreecommitdiff
path: root/db/migrate
diff options
context:
space:
mode:
authorKamil Trzciński <ayufan@ayufan.eu>2019-06-18 13:41:44 +0000
committerKamil Trzciński <ayufan@ayufan.eu>2019-06-18 13:41:44 +0000
commit457db29067aa231cd357ac1b9981adc9548fee75 (patch)
tree04c98503dd2e0a35d0f344ef5f9bda84f8803325 /db/migrate
parent14d46afd9b3ee7482fa8be7bc6782b19e960ce45 (diff)
parent03000c8f26e85f5bc8bbfe292af7ffd1bcc38d29 (diff)
downloadgitlab-ce-457db29067aa231cd357ac1b9981adc9548fee75.tar.gz
Merge branch '57918-encrypt-feature-flags-tokens' into 'master'
Add migrations needed to encrypt feature flags client tokens See merge request gitlab-org/gitlab-ce!29320
Diffstat (limited to 'db/migrate')
-rw-r--r--db/migrate/20190606054649_change_operations_feature_flags_clients_token_not_null.rb11
-rw-r--r--db/migrate/20190606054742_add_token_encrypted_to_operations_feature_flags_clients.rb11
-rw-r--r--db/migrate/20190606054832_add_index_to_operations_feature_flags_clients_token_encrypted.rb18
3 files changed, 40 insertions, 0 deletions
diff --git a/db/migrate/20190606054649_change_operations_feature_flags_clients_token_not_null.rb b/db/migrate/20190606054649_change_operations_feature_flags_clients_token_not_null.rb
new file mode 100644
index 00000000000..c9dbb48f5bd
--- /dev/null
+++ b/db/migrate/20190606054649_change_operations_feature_flags_clients_token_not_null.rb
@@ -0,0 +1,11 @@
+# frozen_string_literal: true
+
+class ChangeOperationsFeatureFlagsClientsTokenNotNull < ActiveRecord::Migration[5.1]
+ include Gitlab::Database::MigrationHelpers
+
+ DOWNTIME = false
+
+ def change
+ change_column_null :operations_feature_flags_clients, :token, true
+ end
+end
diff --git a/db/migrate/20190606054742_add_token_encrypted_to_operations_feature_flags_clients.rb b/db/migrate/20190606054742_add_token_encrypted_to_operations_feature_flags_clients.rb
new file mode 100644
index 00000000000..024b5bd2ba5
--- /dev/null
+++ b/db/migrate/20190606054742_add_token_encrypted_to_operations_feature_flags_clients.rb
@@ -0,0 +1,11 @@
+# frozen_string_literal: true
+
+class AddTokenEncryptedToOperationsFeatureFlagsClients < ActiveRecord::Migration[5.1]
+ include Gitlab::Database::MigrationHelpers
+
+ DOWNTIME = false
+
+ def change
+ add_column :operations_feature_flags_clients, :token_encrypted, :string
+ end
+end
diff --git a/db/migrate/20190606054832_add_index_to_operations_feature_flags_clients_token_encrypted.rb b/db/migrate/20190606054832_add_index_to_operations_feature_flags_clients_token_encrypted.rb
new file mode 100644
index 00000000000..5627457af5c
--- /dev/null
+++ b/db/migrate/20190606054832_add_index_to_operations_feature_flags_clients_token_encrypted.rb
@@ -0,0 +1,18 @@
+# frozen_string_literal: true
+
+class AddIndexToOperationsFeatureFlagsClientsTokenEncrypted < ActiveRecord::Migration[5.1]
+ include Gitlab::Database::MigrationHelpers
+
+ DOWNTIME = false
+
+ disable_ddl_transaction!
+
+ def up
+ add_concurrent_index :operations_feature_flags_clients, [:project_id, :token_encrypted],
+ unique: true, name: "index_feature_flags_clients_on_project_id_and_token_encrypted"
+ end
+
+ def down
+ remove_concurrent_index_by_name :operations_feature_flags_clients, "index_feature_flags_clients_on_project_id_and_token_encrypted"
+ end
+end