From 1c0fc92c719f3856653d0efcc5fe4a1fa30b7bac Mon Sep 17 00:00:00 2001
From: Trygve Laugstøl <trygvis@inamo.no>
Date: Sun, 9 Jun 2013 23:22:39 +0200
Subject: wip

---
 src/main/resources/create-postgresql.sql | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

(limited to 'src/main/resources/create-postgresql.sql')

diff --git a/src/main/resources/create-postgresql.sql b/src/main/resources/create-postgresql.sql
index 4773a0c..7c331fd 100644
--- a/src/main/resources/create-postgresql.sql
+++ b/src/main/resources/create-postgresql.sql
@@ -14,7 +14,7 @@ CREATE TABLE task (
   id        BIGINT       NOT NULL,
   parent    BIGINT,
   queue     VARCHAR(100) NOT NULL,
-  state     VARCHAR(100) NOT NULL,
+  state     CHAR(10)    NOT NULL,
   scheduled TIMESTAMP    NOT NULL,
   last_run  TIMESTAMP,
   run_count INT          NOT NULL,
@@ -25,6 +25,8 @@ CREATE TABLE task (
   CONSTRAINT fk_task__parent FOREIGN KEY (parent) REFERENCES task (id)
 );
 
+CREATE INDEX ix_task__queue__state ON task (queue, state);
+
 CREATE SEQUENCE task_seq;
 
 COMMIT;
-- 
cgit v1.2.3

