[Collab-qa-commits] r374 - svnbuildstat

goneri-guest at alioth.debian.org goneri-guest at alioth.debian.org
Fri Aug 10 22:34:26 UTC 2007


Author: goneri-guest
Date: 2007-08-10 22:34:26 +0000 (Fri, 10 Aug 2007)
New Revision: 374

Modified:
   svnbuildstat/schema-pg.sql
Log:
fix some contraint to be able to delete package and add arch in package


Modified: svnbuildstat/schema-pg.sql
===================================================================
--- svnbuildstat/schema-pg.sql	2007-08-08 14:48:38 UTC (rev 373)
+++ svnbuildstat/schema-pg.sql	2007-08-10 22:34:26 UTC (rev 374)
@@ -269,7 +269,12 @@
     isnative boolean DEFAULT false,
     lastcheck timestamp without time zone,
     iswatchfilebroken boolean,
-    lastbuildstart timestamp without time zone
+    lastbuildstart timestamp without time zone,
+    blacklisted boolean DEFAULT false,
+    i386 boolean DEFAULT true,
+    powerpc boolean DEFAULT true,
+    amd64 boolean DEFAULT true,
+    sparc boolean DEFAULT true
 );
 
 
@@ -335,7 +340,7 @@
 --
 
 CREATE VIEW viewpackage AS
-    SELECT DISTINCT count(build.id) AS builded, max(lintiancount(build.id)) AS lintiancount, max(lintianerrcount(build.id)) AS lintianerrcount, max(lindacount(build.id)) AS lindacount, max(lindaerrcount(build.id)) AS lindaerrcount, bool_or(build.buildisok) AS buildisok, bool_or(build.piupartsisok) AS piupartsisok, max(build."time") AS lastbuilddate, package.id AS package_id, package.name, package.repository_id, package.isindebian, package.isuptodate, package.tarballuri, package.uri, package.isnative, package.iswatchfilebroken, count(bug.bug_id) AS bugcount, max(bug.severity_id) AS bugmaxseverity, package.istarballpresent, package.svndebrelease, package.lastbuildstart FROM ((package LEFT JOIN build build ON ((((package.id = build.package_id) AND (package.rev = (build.rev)::text)) AND (build.isbuildinprogress = false)))) LEFT JOIN bug ON ((package.id = bug.package_id))) GROUP BY package.id, package.name, package.repository_id, package.isindebian, package.isuptodate, package.istarballpresent, package.tarballuri, package.uri, package.svndebrelease, package.isnative, package.iswatchfilebroken, package.lastbuildstart ORDER BY count(build.id), max(lintiancount(build.id)), max(lintianerrcount(build.id)), max(lindacount(build.id)), max(lindaerrcount(build.id)), bool_or(build.buildisok), bool_or(build.piupartsisok), max(build."time"), package.id, package.name, package.repository_id, package.isindebian, package.isuptodate, package.tarballuri, package.uri, package.isnative, package.iswatchfilebroken, count(bug.bug_id), max(bug.severity_id), package.istarballpresent, package.svndebrelease, package.lastbuildstart;
+    SELECT DISTINCT count(build.id) AS builded, max(lintiancount(build.id)) AS lintiancount, max(lintianerrcount(build.id)) AS lintianerrcount, max(lindacount(build.id)) AS lindacount, max(lindaerrcount(build.id)) AS lindaerrcount, bool_or(build.buildisok) AS buildisok, bool_or(build.piupartsisok) AS piupartsisok, max(build."time") AS lastbuilddate, package.id AS package_id, package.name, package.repository_id, package.isindebian, package.isuptodate, package.tarballuri, package.uri, package.isnative, package.iswatchfilebroken, count(bug.bug_id) AS bugcount, max(bug.severity_id) AS bugmaxseverity, package.istarballpresent, package.svndebrelease, package.lastbuildstart FROM ((package LEFT JOIN build build ON (((package.id = build.package_id) AND (package.rev = (build.rev)::text)))) LEFT JOIN bug ON ((package.id = bug.package_id))) GROUP BY package.id, package.name, package.repository_id, package.isindebian, package.isuptodate, package.istarballpresent, package.tarballuri, package.uri, package.svndebrelease, package.isnative, package.iswatchfilebroken, package.lastbuildstart ORDER BY count(build.id), max(lintiancount(build.id)), max(lintianerrcount(build.id)), max(lindacount(build.id)), max(lindaerrcount(build.id)), bool_or(build.buildisok), bool_or(build.piupartsisok), max(build."time"), package.id, package.name, package.repository_id, package.isindebian, package.isuptodate, package.tarballuri, package.uri, package.isnative, package.iswatchfilebroken, count(bug.bug_id), max(bug.severity_id), package.istarballpresent, package.svndebrelease, package.lastbuildstart;
 
 
 --
@@ -343,7 +348,7 @@
 --
 
 CREATE VIEW viewpackage2 AS
-    SELECT DISTINCT count(build.id) AS builded, max(lintiancount(build.id)) AS lintiancount, max(lintianerrcount(build.id)) AS lintianerrcount, max(lindacount(build.id)) AS lindacount, max(lindaerrcount(build.id)) AS lindaerrcount, bool_or(build.buildisok) AS buildisok, bool_or(build.piupartsisok) AS piupartsisok, max(build."time") AS lastbuilddate, package.id AS package_id, package.name, package.repository_id, package.isindebian, package.isuptodate, package.tarballuri, package.uri, package.isnative, package.iswatchfilebroken, count(bug.bug_id) AS bugcount, max(bug.severity_id) AS bugmaxseverity, package.istarballpresent, package.svndebrelease, package.lastbuildstart, bool_or(build.isbuildinprogress) AS isbuildinprogress FROM ((package LEFT JOIN build build ON ((((package.id = build.package_id) AND (package.rev = (build.rev)::text)) AND (build.isbuildinprogress = false)))) LEFT JOIN bug ON ((package.id = bug.package_id))) GROUP BY package.id, package.name, package.repository_id, package.isindebian, package.isuptodate, package.istarballpresent, package.tarballuri, package.uri, package.svndebrelease, package.isnative, package.iswatchfilebroken, package.lastbuildstart ORDER BY count(build.id), max(lintiancount(build.id)), max(lintianerrcount(build.id)), max(lindacount(build.id)), max(lindaerrcount(build.id)), bool_or(build.buildisok), bool_or(build.piupartsisok), max(build."time"), package.id, package.name, package.repository_id, package.isindebian, package.isuptodate, package.tarballuri, package.uri, package.isnative, package.iswatchfilebroken, count(bug.bug_id), max(bug.severity_id), package.istarballpresent, package.svndebrelease, package.lastbuildstart, bool_or(build.isbuildinprogress);
+    SELECT DISTINCT count(build.id) AS builded, max(lintiancount(build.id)) AS lintiancount, max(lintianerrcount(build.id)) AS lintianerrcount, max(lindacount(build.id)) AS lindacount, max(lindaerrcount(build.id)) AS lindaerrcount, bool_or(build.buildisok) AS buildisok, bool_or(build.piupartsisok) AS piupartsisok, max(build."time") AS lastbuilddate, package.id AS package_id, package.name, package.repository_id, package.isindebian, package.isuptodate, package.tarballuri, package.uri, package.isnative, package.iswatchfilebroken, count(bug.bug_id) AS bugcount, max(bug.severity_id) AS bugmaxseverity, package.istarballpresent, package.svndebrelease, package.lastbuildstart FROM ((package LEFT JOIN build build ON (((package.id = build.package_id) AND (package.rev = (build.rev)::text)))) LEFT JOIN bug ON ((package.id = bug.package_id))) GROUP BY package.id, package.name, package.repository_id, package.isindebian, package.isuptodate, package.istarballpresent, package.tarballuri, package.uri, package.svndebrelease, package.isnative, package.iswatchfilebroken, package.lastbuildstart ORDER BY count(build.id), max(lintiancount(build.id)), max(lintianerrcount(build.id)), max(lindacount(build.id)), max(lindaerrcount(build.id)), bool_or(build.buildisok), bool_or(build.piupartsisok), max(build."time"), package.id, package.name, package.repository_id, package.isindebian, package.isuptodate, package.tarballuri, package.uri, package.isnative, package.iswatchfilebroken, count(bug.bug_id), max(bug.severity_id), package.istarballpresent, package.svndebrelease, package.lastbuildstart;
 
 
 --
@@ -351,7 +356,7 @@
 --
 
 CREATE VIEW viewtobuild AS
-    SELECT package.id AS package_id FROM (package LEFT JOIN build ON ((((package.id = build.package_id) AND (package.rev = (build.rev)::text)) AND (build.isbuildinprogress = false)))) WHERE (((((package.isnative = true) OR (package.isnative = false)) AND (package.istarballpresent = true)) AND (package.lastbuildstart IS NULL)) OR (package.lastbuildstart < (now() - '03:00:00'::interval))) ORDER BY (build.id IS NOT NULL), build."time";
+    SELECT package.id AS package_id FROM (package LEFT JOIN build ON ((((package.id = build.package_id) AND (package.rev = (build.rev)::text)) AND (build.isbuildinprogress = false)))) WHERE (((package.blacklisted = false) AND ((package.isnative = true) OR ((package.isnative = false) AND (package.istarballpresent = true)))) AND ((package.lastbuildstart IS NULL) OR (package.lastbuildstart < (now() - '03:00:00'::interval)))) ORDER BY (build.id IS NOT NULL), build."time";
 
 
 --
@@ -484,104 +489,104 @@
 -- Name: $1; Type: FK CONSTRAINT; Schema: public; Owner: svnbuildstat
 --
 
-ALTER TABLE ONLY build_linda
-    ADD CONSTRAINT "$1" FOREIGN KEY (build_id) REFERENCES build(id);
+ALTER TABLE ONLY host
+    ADD CONSTRAINT "$1" FOREIGN KEY (maintainer_id) REFERENCES maintainer(id);
 
 
 --
--- Name: $1; Type: FK CONSTRAINT; Schema: public; Owner: svnbuildstat
+-- Name: $2; Type: FK CONSTRAINT; Schema: public; Owner: svnbuildstat
 --
 
-ALTER TABLE ONLY build_lintian
-    ADD CONSTRAINT "$1" FOREIGN KEY (build_id) REFERENCES build(id);
+ALTER TABLE ONLY build_linda
+    ADD CONSTRAINT "$2" FOREIGN KEY (linda_id) REFERENCES linda(id);
 
 
 --
--- Name: $1; Type: FK CONSTRAINT; Schema: public; Owner: svnbuildstat
+-- Name: $2; Type: FK CONSTRAINT; Schema: public; Owner: svnbuildstat
 --
 
-ALTER TABLE ONLY host
-    ADD CONSTRAINT "$1" FOREIGN KEY (maintainer_id) REFERENCES maintainer(id);
+ALTER TABLE ONLY build_lintian
+    ADD CONSTRAINT "$2" FOREIGN KEY (lintian_id) REFERENCES lintian(id);
 
 
 --
--- Name: $1; Type: FK CONSTRAINT; Schema: public; Owner: svnbuildstat
+-- Name: $2; Type: FK CONSTRAINT; Schema: public; Owner: svnbuildstat
 --
 
-ALTER TABLE ONLY package
-    ADD CONSTRAINT "$1" FOREIGN KEY (repository_id) REFERENCES repository(id);
+ALTER TABLE ONLY package_maintainer
+    ADD CONSTRAINT "$2" FOREIGN KEY (maintainer_id) REFERENCES maintainer(id);
 
 
 --
--- Name: $1; Type: FK CONSTRAINT; Schema: public; Owner: svnbuildstat
+-- Name: $2; Type: FK CONSTRAINT; Schema: public; Owner: svnbuildstat
 --
 
-ALTER TABLE ONLY package_maintainer
-    ADD CONSTRAINT "$1" FOREIGN KEY (package_id) REFERENCES package(id);
+ALTER TABLE ONLY build
+    ADD CONSTRAINT "$2" FOREIGN KEY (host_id) REFERENCES host(id);
 
 
 --
--- Name: $1; Type: FK CONSTRAINT; Schema: public; Owner: svnbuildstat
+-- Name: $3; Type: FK CONSTRAINT; Schema: public; Owner: svnbuildstat
 --
 
 ALTER TABLE ONLY build
-    ADD CONSTRAINT "$1" FOREIGN KEY (package_id) REFERENCES package(id);
+    ADD CONSTRAINT "$3" FOREIGN KEY (arch_id) REFERENCES arch(id);
 
 
 --
--- Name: $1; Type: FK CONSTRAINT; Schema: public; Owner: svnbuildstat
+-- Name: bug_package_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: svnbuildstat
 --
 
 ALTER TABLE ONLY bug
-    ADD CONSTRAINT "$1" FOREIGN KEY (severity_id) REFERENCES severity(id);
+    ADD CONSTRAINT bug_package_id_fkey FOREIGN KEY (package_id) REFERENCES package(id) ON DELETE CASCADE;
 
 
 --
--- Name: $2; Type: FK CONSTRAINT; Schema: public; Owner: svnbuildstat
+-- Name: bug_severity_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: svnbuildstat
 --
 
-ALTER TABLE ONLY build_linda
-    ADD CONSTRAINT "$2" FOREIGN KEY (linda_id) REFERENCES linda(id);
+ALTER TABLE ONLY bug
+    ADD CONSTRAINT bug_severity_id_fkey FOREIGN KEY (severity_id) REFERENCES severity(id) ON DELETE RESTRICT;
 
 
 --
--- Name: $2; Type: FK CONSTRAINT; Schema: public; Owner: svnbuildstat
+-- Name: build_linda_build_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: svnbuildstat
 --
 
-ALTER TABLE ONLY build_lintian
-    ADD CONSTRAINT "$2" FOREIGN KEY (lintian_id) REFERENCES lintian(id);
+ALTER TABLE ONLY build_linda
+    ADD CONSTRAINT build_linda_build_id_fkey FOREIGN KEY (build_id) REFERENCES build(id) ON DELETE CASCADE;
 
 
 --
--- Name: $2; Type: FK CONSTRAINT; Schema: public; Owner: svnbuildstat
+-- Name: build_lintian_build_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: svnbuildstat
 --
 
-ALTER TABLE ONLY package_maintainer
-    ADD CONSTRAINT "$2" FOREIGN KEY (maintainer_id) REFERENCES maintainer(id);
+ALTER TABLE ONLY build_lintian
+    ADD CONSTRAINT build_lintian_build_id_fkey FOREIGN KEY (build_id) REFERENCES build(id) ON DELETE CASCADE;
 
 
 --
--- Name: $2; Type: FK CONSTRAINT; Schema: public; Owner: svnbuildstat
+-- Name: build_package_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: svnbuildstat
 --
 
 ALTER TABLE ONLY build
-    ADD CONSTRAINT "$2" FOREIGN KEY (host_id) REFERENCES host(id);
+    ADD CONSTRAINT build_package_id_fkey FOREIGN KEY (package_id) REFERENCES package(id) ON DELETE CASCADE;
 
 
 --
--- Name: $2; Type: FK CONSTRAINT; Schema: public; Owner: svnbuildstat
+-- Name: package_maintainer_package_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: svnbuildstat
 --
 
-ALTER TABLE ONLY bug
-    ADD CONSTRAINT "$2" FOREIGN KEY (package_id) REFERENCES package(id);
+ALTER TABLE ONLY package_maintainer
+    ADD CONSTRAINT package_maintainer_package_id_fkey FOREIGN KEY (package_id) REFERENCES package(id) ON DELETE CASCADE;
 
 
 --
--- Name: $3; Type: FK CONSTRAINT; Schema: public; Owner: svnbuildstat
+-- Name: package_repository_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: svnbuildstat
 --
 
-ALTER TABLE ONLY build
-    ADD CONSTRAINT "$3" FOREIGN KEY (arch_id) REFERENCES arch(id);
+ALTER TABLE ONLY package
+    ADD CONSTRAINT package_repository_id_fkey FOREIGN KEY (repository_id) REFERENCES repository(id) ON DELETE RESTRICT;
 
 
 --




More information about the Collab-qa-commits mailing list