diff options
author | Shinya Maeda <shinya@gitlab.com> | 2018-09-27 12:23:02 +0300 |
---|---|---|
committer | Alessio Caiazza <acaiazza@gitlab.com> | 2018-10-02 18:08:12 +0300 |
commit | 6fb1e0d8884fb7e64cb3f98ccd84c9b4db5096ac (patch) | |
tree | 7329cb6008dce4a45d026bd1458eb6d8c37b0c78 /db | |
parent | 587560757faaedb6c61ef7aa77f11934cb76084b (diff) |
Fix partial index for scheduled_at
Diffstat (limited to 'db')
-rw-r--r-- | db/migrate/20180924201039_add_partial_index_to_scheduled_at.rb | 2 | ||||
-rw-r--r-- | db/schema.rb | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/db/migrate/20180924201039_add_partial_index_to_scheduled_at.rb b/db/migrate/20180924201039_add_partial_index_to_scheduled_at.rb index 1b79365a0f6..19326e63839 100644 --- a/db/migrate/20180924201039_add_partial_index_to_scheduled_at.rb +++ b/db/migrate/20180924201039_add_partial_index_to_scheduled_at.rb @@ -9,7 +9,7 @@ class AddPartialIndexToScheduledAt < ActiveRecord::Migration disable_ddl_transaction! def up - add_concurrent_index(:ci_builds, :id, where: "scheduled_at <> NULL", name: INDEX_NAME) + add_concurrent_index(:ci_builds, :id, where: "scheduled_at IS NOT NULL", name: INDEX_NAME) end def down diff --git a/db/schema.rb b/db/schema.rb index aec446a2f2e..f19fab6a26b 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -344,7 +344,7 @@ ActiveRecord::Schema.define(version: 20180924201039) do add_index "ci_builds", ["commit_id", "type", "name", "ref"], name: "index_ci_builds_on_commit_id_and_type_and_name_and_ref", using: :btree add_index "ci_builds", ["commit_id", "type", "ref"], name: "index_ci_builds_on_commit_id_and_type_and_ref", using: :btree add_index "ci_builds", ["id"], name: "partial_index_ci_builds_on_id_with_legacy_artifacts", where: "(artifacts_file <> ''::text)", using: :btree - add_index "ci_builds", ["id"], name: "partial_index_ci_builds_on_id_with_scheduled_jobs", where: "(scheduled_at <> NULL::timestamp with time zone)", using: :btree + add_index "ci_builds", ["id"], name: "partial_index_ci_builds_on_id_with_scheduled_jobs", where: "(scheduled_at IS NOT NULL)", using: :btree add_index "ci_builds", ["project_id", "id"], name: "index_ci_builds_on_project_id_and_id", using: :btree add_index "ci_builds", ["protected"], name: "index_ci_builds_on_protected", using: :btree add_index "ci_builds", ["runner_id"], name: "index_ci_builds_on_runner_id", using: :btree |