From 03f4ad4323bed8bc04ad3d93a50e187e6677281e Mon Sep 17 00:00:00 2001 From: Grzegorz Bizon Date: Thu, 29 Nov 2018 11:54:35 +0100 Subject: Add encrypted token field to ci_builds table --- .../20181129104854_add_token_encrypted_to_ci_builds.rb | 11 +++++++++++ ...1129104944_add_index_to_ci_builds_token_encrypted.rb | 17 +++++++++++++++++ 2 files changed, 28 insertions(+) create mode 100644 db/migrate/20181129104854_add_token_encrypted_to_ci_builds.rb create mode 100644 db/migrate/20181129104944_add_index_to_ci_builds_token_encrypted.rb (limited to 'db/migrate') diff --git a/db/migrate/20181129104854_add_token_encrypted_to_ci_builds.rb b/db/migrate/20181129104854_add_token_encrypted_to_ci_builds.rb new file mode 100644 index 00000000000..11b98203793 --- /dev/null +++ b/db/migrate/20181129104854_add_token_encrypted_to_ci_builds.rb @@ -0,0 +1,11 @@ +# frozen_string_literal: true + +class AddTokenEncryptedToCiBuilds < ActiveRecord::Migration[5.0] + include Gitlab::Database::MigrationHelpers + + DOWNTIME = false + + def change + add_column :ci_builds, :token_encrypted, :string + end +end diff --git a/db/migrate/20181129104944_add_index_to_ci_builds_token_encrypted.rb b/db/migrate/20181129104944_add_index_to_ci_builds_token_encrypted.rb new file mode 100644 index 00000000000..198d94fa7be --- /dev/null +++ b/db/migrate/20181129104944_add_index_to_ci_builds_token_encrypted.rb @@ -0,0 +1,17 @@ +# frozen_string_literal: true + +class AddIndexToCiBuildsTokenEncrypted < ActiveRecord::Migration[5.0] + include Gitlab::Database::MigrationHelpers + + DOWNTIME = false + + disable_ddl_transaction! + + def up + add_concurrent_index :ci_builds, :token_encrypted, unique: true + end + + def down + remove_concurrent_index :ci_builds, :token_encrypted + end +end -- cgit v1.2.1