From: Michael Tremer Date: Sat, 21 Oct 2017 15:01:54 +0000 (+0100) Subject: jobs: Drop type column X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=f93059e07d744741376a211d6fb0ec706e5297b0;p=people%2Fjschlag%2Fpbs.git jobs: Drop type column Signed-off-by: Michael Tremer --- diff --git a/src/database.sql b/src/database.sql index 61d3b7a..53b57c5 100644 --- a/src/database.sql +++ b/src/database.sql @@ -853,7 +853,6 @@ ALTER SEQUENCE builds_id_seq OWNED BY builds.id; CREATE TABLE jobs ( id integer NOT NULL, uuid text NOT NULL, - type jobs_type DEFAULT 'build'::jobs_type NOT NULL, build_id integer NOT NULL, state jobs_state DEFAULT 'new'::jobs_state NOT NULL, arch text NOT NULL, @@ -1164,7 +1163,7 @@ ALTER SEQUENCE jobs_packages_id_seq OWNED BY jobs_packages.id; CREATE VIEW jobs_queue AS WITH queue AS ( SELECT jobs.id, - rank() OVER (ORDER BY jobs.type, builds.priority DESC, jobs.time_created) AS rank + rank() OVER (ORDER BY (NOT jobs.test), builds.priority DESC, jobs.time_created) AS rank FROM (jobs LEFT JOIN builds ON ((jobs.build_id = builds.id))) WHERE (jobs.state = 'pending'::jobs_state)