diff options
Diffstat (limited to 'src/main/resources')
-rw-r--r-- | src/main/resources/create.sql | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/main/resources/create.sql b/src/main/resources/create.sql index ed8913f..f7f2939 100644 --- a/src/main/resources/create.sql +++ b/src/main/resources/create.sql @@ -11,7 +11,8 @@ CREATE TABLE queue ( ); CREATE TABLE task ( - id INTEGER NOT NULL, + id BIGINT NOT NULL, + parent BIGINT NOT NULL, queue VARCHAR(100) NOT NULL, scheduled TIMESTAMP NOT NULL, last_run TIMESTAMP, @@ -19,7 +20,8 @@ CREATE TABLE task ( completed TIMESTAMP, arguments VARCHAR(100), CONSTRAINT pk_task PRIMARY KEY (id), - CONSTRAINT fk_task__queue FOREIGN KEY (queue) REFERENCES queue (name) + CONSTRAINT fk_task__queue FOREIGN KEY (queue) REFERENCES queue (name), + CONSTRAINT fk_task__parent FOREIGN KEY (parent) REFERENCES task (id) ); CREATE SEQUENCE task_id; |