From b65d39ab617d19ac48f44bc41f04a18803ca75e6 Mon Sep 17 00:00:00 2001 From: Trygve Laugstøl Date: Sun, 26 May 2013 10:42:01 +0200 Subject: o Adding a 'parent' reference so tasks can be put in a tree. --- src/main/resources/create.sql | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'src/main/resources') 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; -- cgit v1.2.3