Split migration to add and index namespaces.runners_token

This commit is contained in:
Dylan Griffith 2018-05-03 17:08:06 +02:00
parent 794ac6c542
commit dd74237ddc
3 changed files with 16 additions and 10 deletions

View file

@ -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

View file

@ -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

View file

@ -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"