Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/db
diff options
context:
space:
mode:
authorGrzegorz Bizon <grzesiek.bizon@gmail.com>2018-12-05 17:15:25 +0300
committerGrzegorz Bizon <grzesiek.bizon@gmail.com>2018-12-05 17:15:25 +0300
commit73f872448b59600eca792f9a34e2c8bfa976afde (patch)
treeefdb75081035ace49b0289fe562913583b36517c /db
parent6de0eb032e7895f26a01801bd47becace26852a0 (diff)
Use partial NOT NULL index for token_encrypted field
Diffstat (limited to 'db')
-rw-r--r--db/migrate/20181129104944_add_index_to_ci_builds_token_encrypted.rb2
-rw-r--r--db/schema.rb2
2 files changed, 2 insertions, 2 deletions
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
index 198d94fa7be..f90aca008e5 100644
--- a/db/migrate/20181129104944_add_index_to_ci_builds_token_encrypted.rb
+++ b/db/migrate/20181129104944_add_index_to_ci_builds_token_encrypted.rb
@@ -8,7 +8,7 @@ class AddIndexToCiBuildsTokenEncrypted < ActiveRecord::Migration[5.0]
disable_ddl_transaction!
def up
- add_concurrent_index :ci_builds, :token_encrypted, unique: true
+ add_concurrent_index :ci_builds, :token_encrypted, unique: true, where: 'token_encrypted IS NOT NULL'
end
def down
diff --git a/db/schema.rb b/db/schema.rb
index e6417f6ceb4..39912f5107b 100644
--- a/db/schema.rb
+++ b/db/schema.rb
@@ -361,7 +361,7 @@ ActiveRecord::Schema.define(version: 20181129104944) do
t.index ["stage_id"], name: "index_ci_builds_on_stage_id", using: :btree
t.index ["status", "type", "runner_id"], name: "index_ci_builds_on_status_and_type_and_runner_id", using: :btree
t.index ["token"], name: "index_ci_builds_on_token", unique: true, using: :btree
- t.index ["token_encrypted"], name: "index_ci_builds_on_token_encrypted", unique: true, using: :btree
+ t.index ["token_encrypted"], name: "index_ci_builds_on_token_encrypted", unique: true, where: "(token_encrypted IS NOT NULL)", using: :btree
t.index ["updated_at"], name: "index_ci_builds_on_updated_at", using: :btree
t.index ["user_id"], name: "index_ci_builds_on_user_id", using: :btree
end