summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristoph Berg2012-08-26 07:18:55 +0000
committerChristoph Berg2012-08-26 07:18:55 +0000
commit827858a0aa5bdbcc84334537a2aa2a6af2ad608e (patch)
treeb7ab587aa72e4cb60de34a2dc135dfd1b84c99ed
parenta0157a60e045df0411778f325130a9e699e33a9b (diff)
Commit sql changes from June
-rw-r--r--pgapt-db/sql/pgapt.sql22
1 files changed, 16 insertions, 6 deletions
diff --git a/pgapt-db/sql/pgapt.sql b/pgapt-db/sql/pgapt.sql
index fca94a1..89b1df3 100644
--- a/pgapt-db/sql/pgapt.sql
+++ b/pgapt-db/sql/pgapt.sql
@@ -15,7 +15,8 @@ CREATE OR REPLACE VIEW package_view AS
-- All sources
CREATE OR REPLACE VIEW source_view AS
- SELECT l.suite_id, su.suite, su.component, s.package_id AS source_id, s.package AS source_package, s.version AS source_version
+ SELECT l.suite_id, su.suite, su.component, su.active,
+ s.package_id AS source_id, s.package AS source_package, s.version AS source_version
FROM package s
JOIN packagelist l USING (package_id)
JOIN suite su USING (suite_id)
@@ -27,9 +28,12 @@ CREATE OR REPLACE VIEW source_view AS
-- Sources never built in a suite
CREATE OR REPLACE VIEW missing_source AS
- SELECT suite.suite, sid.source_package AS package, sid.source_version AS version
+ SELECT suite.suite, sid.source_package AS package, sid.source_version AS sid_version
FROM suite, source_view sid
- WHERE suite.architecture = 'source'::text AND sid.suite = 'sid-pgapt'::text AND NOT (EXISTS ( SELECT other.suite_id, other.suite, other.component, other.source_id, other.source_package, other.source_version
+ WHERE suite.architecture = 'source'::text AND
+ suite.active = true AND
+ sid.suite = 'sid-pgapt'::text AND
+ NOT (EXISTS ( SELECT other.suite_id, other.suite, other.component, other.source_id, other.source_package, other.source_version
FROM source_view other
WHERE other.source_package = sid.source_package AND other.suite = suite.suite));
@@ -38,14 +42,17 @@ CREATE OR REPLACE VIEW outdated_source AS
SELECT other.suite, other.source_package AS package, other.source_version AS version, sid.source_version AS sid_version
FROM source_view sid
JOIN source_view other ON sid.source_package = other.source_package
- WHERE sid.suite = 'sid-pgapt'::text AND other.suite <> 'sid-pgapt'::text AND (sid.source_version::text || '~'::text) > (other.source_version::text || '~'::text);
+ WHERE sid.suite = 'sid-pgapt'::text AND
+ other.suite <> 'sid-pgapt'::text AND
+ other.active = true AND
+ (sid.source_version::text || '~'::text) > (other.source_version::text || '~'::text);
-- Source TODO list
CREATE OR REPLACE VIEW todo_source AS
SELECT outdated_source.suite, outdated_source.package, outdated_source.version, outdated_source.sid_version
FROM outdated_source
UNION ALL
- SELECT missing_source.suite, missing_source.package, NULL::debversion, missing_source.version AS sid_version
+ SELECT missing_source.suite, missing_source.package, NULL::debversion, missing_source.sid_version
FROM missing_source;
-- Binary
@@ -54,7 +61,10 @@ UNION ALL
CREATE OR REPLACE VIEW missing_binary AS
SELECT suite.suite, suite.architecture, sid.package, sid.source_package, sid.source_version AS new_source_version
FROM package_view sid, suite
- WHERE sid.suite = 'sid-pgapt'::text AND suite.architecture = sid.architecture AND NOT (EXISTS ( SELECT other.suite_id, other.suite, other.component, other.architecture, other.package_id, other.package, other.version, other.pkg_architecture, other.source_id, other.source_package, other.source_version
+ WHERE sid.suite = 'sid-pgapt'::text AND
+ suite.architecture = sid.architecture AND
+ suite.active = true AND
+ NOT (EXISTS ( SELECT other.suite_id, other.suite, other.component, other.architecture, other.package_id, other.package, other.version, other.pkg_architecture, other.source_id, other.source_package, other.source_version
FROM package_view other
WHERE sid.package = other.package AND other.suite = suite.suite));