Skip to content

Commit

Permalink
Add task queue migration
Browse files Browse the repository at this point in the history
  • Loading branch information
jakewmeyer committed Nov 21, 2023
1 parent 5c775f3 commit cf91911
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 0 deletions.
File renamed without changes.
File renamed without changes.
1 change: 1 addition & 0 deletions migrations/0002_create_tasks.down.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
DROP TABLE tasks;
9 changes: 9 additions & 0 deletions migrations/0002_create_tasks.up.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
CREATE TABLE tasks(
id UUID NOT NULL PRIMARY KEY,
type TEXT NOT NULL,
priority INT NOT NULL DEFAULT 0,
payload JSONB NOT NULL,
created TIMESTAMPTZ NOT NULL DEFAULT NOW(),
UNIQUE(type, payload)
);
CREATE INDEX tasks_priority_idx ON tasks(priority);

0 comments on commit cf91911

Please sign in to comment.