Skip to content

Commit

Permalink
fix: Make liteq.Setup rerunnable
Browse files Browse the repository at this point in the history
  • Loading branch information
asmfreak committed Aug 13, 2024
1 parent a0757c7 commit 74c119c
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions db/schema.sql
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
PRAGMA journal_mode = WAL;

CREATE TABLE jobs (
CREATE TABLE IF NOT EXISTS jobs (
id INTEGER NOT NULL,
queue TEXT NOT NULL,
job TEXT NOT NULL,
Expand All @@ -16,12 +16,12 @@ CREATE TABLE jobs (
PRIMARY KEY (id)
);

CREATE INDEX todo ON jobs (queue, job_status, execute_after)
CREATE INDEX IF NOT EXISTS todo ON jobs (queue, job_status, execute_after)
WHERE
job_status = 'queued'
OR job_status = 'fetched';

CREATE UNIQUE INDEX dedupe ON jobs (deduping_key, job_status)
CREATE UNIQUE INDEX IF NOT EXISTS dedupe ON jobs (deduping_key, job_status)
WHERE
deduping_key != ''
AND job_status = 'queued';

0 comments on commit 74c119c

Please sign in to comment.