diff --git a/db/migrate/20231103204612_create_solid_queue_concurrency_controls.rb b/db/migrate/20231103204612_create_solid_queue_concurrency_controls.rb index c1b9ec28..b037f8c1 100644 --- a/db/migrate/20231103204612_create_solid_queue_concurrency_controls.rb +++ b/db/migrate/20231103204612_create_solid_queue_concurrency_controls.rb @@ -11,9 +11,12 @@ def change t.integer :priority, default: 0, null: false t.integer :concurrency_limit, null: false - t.string :concurrency_key, null: false, index: true + t.string :concurrency_key, null: false t.datetime :created_at, null: false + + t.index [ :concurrency_key, :priority ], name: "index_solid_queue_blocked_executions_for_release" + t.index [ :queue_name, :concurrency_key ], name: "index_solid_queue_blocked_executions_for_polling" end create_table :solid_queue_semaphores do |t| diff --git a/test/dummy/db/schema.rb b/test/dummy/db/schema.rb index 83a0e892..ccbfcbae 100644 --- a/test/dummy/db/schema.rb +++ b/test/dummy/db/schema.rb @@ -26,8 +26,9 @@ t.integer "concurrency_limit", null: false t.string "concurrency_key", null: false t.datetime "created_at", null: false - t.index ["concurrency_key"], name: "index_solid_queue_blocked_executions_on_concurrency_key" + t.index ["concurrency_key", "priority"], name: "index_solid_queue_blocked_executions_for_release" t.index ["job_id"], name: "index_solid_queue_blocked_executions_on_job_id", unique: true + t.index ["queue_name", "concurrency_key"], name: "index_solid_queue_blocked_executions_for_polling" end create_table "solid_queue_claimed_executions", charset: "utf8mb4", collation: "utf8mb4_0900_ai_ci", force: :cascade do |t| @@ -82,6 +83,8 @@ t.string "queue_name", null: false t.integer "priority", default: 0, null: false t.datetime "created_at", null: false + t.string "concurrency_key" + t.index ["concurrency_key"], name: "index_solid_queue_ready_executions_on_concurrency_key" t.index ["job_id"], name: "index_solid_queue_ready_executions_on_job_id", unique: true t.index ["priority"], name: "index_solid_queue_ready_executions_on_priority" t.index ["queue_name", "priority"], name: "index_solid_queue_ready_executions"