Skip to content

Commit

Permalink
fix: add constraint to priority (#777)
Browse files Browse the repository at this point in the history
* fix: add constraint to priority

* fix: new index

* fix: drop old index

* fix: typo
  • Loading branch information
abelanger5 authored Aug 12, 2024
1 parent 83d2200 commit d4d3512
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
7 changes: 7 additions & 0 deletions sql/migrations/20240812153737_v0.42.1.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
-- atlas:txmode none

ALTER TABLE "QueueItem" ADD CONSTRAINT "QueueItem_priority_check" CHECK ("priority" >= 1 AND "priority" <= 4);

DROP INDEX CONCURRENTLY IF EXISTS "QueueItem_isQueued_priority_tenantId_queue_id_idx";

CREATE INDEX CONCURRENTLY IF NOT EXISTS "QueueItem_isQueued_priority_tenantId_queue_id_idx_2" ON "QueueItem" ("isQueued", "tenantId", "queue", "priority" DESC, "id");
3 changes: 2 additions & 1 deletion sql/migrations/atlas.sum
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
h1:SCesG9pwaIMrH4EijJ5Q2Uc0gvwS18RxoYO5KTsC4xw=
h1:wAFKm7rbprHz28Bc8uTDP6nbnjhMbZeAWPtKZpSteaY=
20240115180414_init.sql h1:Ef3ZyjAHkmJPdGF/dEWCahbwgcg6uGJKnDxW2JCRi2k=
20240122014727_v0_6_0.sql h1:o/LdlteAeFgoHJ3e/M4Xnghqt9826IE/Y/h0q95Acuo=
20240126235456_v0_7_0.sql h1:KiVzt/hXgQ6esbdC6OMJOOWuYEXmy1yeCpmsVAHTFKs=
Expand Down Expand Up @@ -44,3 +44,4 @@ h1:SCesG9pwaIMrH4EijJ5Q2Uc0gvwS18RxoYO5KTsC4xw=
20240726160629_v0.40.0.sql h1:XmnKVQ/AMUTPnL1SZPwLhmY0KR4sT9B6+uhVbElYx34=
20240728042317_v0.41.0.sql h1:kgjgRXSRGMCXAOUweAwlTFd/uWtx7a24gLdJEfbK1rM=
20240809131000_v0.42.0.sql h1:7dk24FIvasOG/vmTI8Oz23C4e6+k3IS9WG5eu2mX/Aw=
20240812153737_v0.42.1.sql h1:dUADhy9vhbGwdrn+h2KqshcdfSUvSUOlF190Sy6xGhw=

0 comments on commit d4d3512

Please sign in to comment.