From dd74237ddc8bef97e45757caf2e91f157e7dd7d2 Mon Sep 17 00:00:00 2001 From: Dylan Griffith Date: Thu, 3 May 2018 17:08:06 +0200 Subject: [PATCH] Split migration to add and index namespaces.runners_token --- .../20170906133745_add_runners_token_to_groups.rb | 10 +--------- ...150427_add_index_to_namespaces_runners_token.rb | 14 ++++++++++++++ db/schema.rb | 2 +- 3 files changed, 16 insertions(+), 10 deletions(-) create mode 100644 db/migrate/20180503150427_add_index_to_namespaces_runners_token.rb diff --git a/db/migrate/20170906133745_add_runners_token_to_groups.rb b/db/migrate/20170906133745_add_runners_token_to_groups.rb index 54d0fddd5e3..852f4cba670 100644 --- a/db/migrate/20170906133745_add_runners_token_to_groups.rb +++ b/db/migrate/20170906133745_add_runners_token_to_groups.rb @@ -3,15 +3,7 @@ class AddRunnersTokenToGroups < ActiveRecord::Migration DOWNTIME = false - disable_ddl_transaction! - - def up + def change add_column :namespaces, :runners_token, :string - - add_concurrent_index :namespaces, :runners_token, unique: true - end - - def down - remove_column :namespaces, :runners_token end end diff --git a/db/migrate/20180503150427_add_index_to_namespaces_runners_token.rb b/db/migrate/20180503150427_add_index_to_namespaces_runners_token.rb new file mode 100644 index 00000000000..d6c4a5c432c --- /dev/null +++ b/db/migrate/20180503150427_add_index_to_namespaces_runners_token.rb @@ -0,0 +1,14 @@ +# See http://doc.gitlab.com/ce/development/migration_style_guide.html +# for more information on how to write migrations for GitLab. + +class AddIndexToNamespacesRunnersToken < ActiveRecord::Migration + include Gitlab::Database::MigrationHelpers + + DOWNTIME = false + + disable_ddl_transaction! + + def change + add_concurrent_index :namespaces, :runners_token, unique: true + end +end diff --git a/db/schema.rb b/db/schema.rb index c88d6f3f9e9..177ad0bf23e 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -11,7 +11,7 @@ # # It's strongly recommended that you check this file into your version control system. -ActiveRecord::Schema.define(version: 20180430143705) do +ActiveRecord::Schema.define(version: 20180503150427) do # These are extensions that must be enabled in order to support this database enable_extension "plpgsql"