Further tweak the package derivation comparison query
This commit is contained in:
parent
e6205e988a
commit
eeb026b654
1 changed files with 8 additions and 10 deletions
|
|
@ -24,6 +24,7 @@
|
|||
#:use-module (json)
|
||||
#:use-module (guix-data-service database)
|
||||
#:use-module (guix-data-service model utils)
|
||||
#:use-module (guix-data-service model system)
|
||||
#:use-module (guix-data-service model derivation)
|
||||
#:export (derivation-differences-data
|
||||
|
||||
|
|
@ -268,7 +269,9 @@ GROUP BY derivation_source_files.store_path"))
|
|||
(define extra-constraints
|
||||
(string-append
|
||||
(if system
|
||||
(string-append " AND systems.system = '" system "'")
|
||||
(string-append
|
||||
" AND package_derivations.system_id = "
|
||||
(number->string (system->system-id conn system)))
|
||||
"")
|
||||
(if targets
|
||||
(string-append
|
||||
|
|
@ -285,13 +288,11 @@ GROUP BY derivation_source_files.store_path"))
|
|||
(string-append "
|
||||
WITH base_packages AS (
|
||||
SELECT packages.*, derivations.id AS derivation_id, derivations.file_name,
|
||||
systems.system, package_derivations.target,
|
||||
package_derivations.target,
|
||||
derivations_by_output_details_set.derivation_output_details_set_id
|
||||
FROM packages
|
||||
INNER JOIN package_derivations
|
||||
ON packages.id = package_derivations.package_id
|
||||
INNER JOIN systems
|
||||
ON package_derivations.system_id = systems.id
|
||||
INNER JOIN derivations
|
||||
ON package_derivations.derivation_id = derivations.id
|
||||
INNER JOIN derivations_by_output_details_set
|
||||
|
|
@ -303,13 +304,11 @@ WITH base_packages AS (
|
|||
)" extra-constraints "
|
||||
), target_packages AS (
|
||||
SELECT packages.*, derivations.id AS derivation_id, derivations.file_name,
|
||||
systems.system, package_derivations.target,
|
||||
package_derivations.target,
|
||||
derivations_by_output_details_set.derivation_output_details_set_id
|
||||
FROM packages
|
||||
INNER JOIN package_derivations
|
||||
ON packages.id = package_derivations.package_id
|
||||
INNER JOIN systems
|
||||
ON package_derivations.system_id = systems.id
|
||||
INNER JOIN derivations
|
||||
ON package_derivations.derivation_id = derivations.id
|
||||
INNER JOIN derivations_by_output_details_set
|
||||
|
|
@ -322,7 +321,7 @@ WITH base_packages AS (
|
|||
)
|
||||
SELECT base_packages.name, base_packages.version,
|
||||
base_packages.package_metadata_id, base_packages.file_name,
|
||||
base_packages.system, base_packages.target,"
|
||||
'" system "', base_packages.target,"
|
||||
(if include-builds?
|
||||
"
|
||||
(
|
||||
|
|
@ -353,7 +352,7 @@ SELECT base_packages.name, base_packages.version,
|
|||
"
|
||||
target_packages.name, target_packages.version,
|
||||
target_packages.package_metadata_id, target_packages.file_name,
|
||||
target_packages.system, target_packages.target"
|
||||
'" system "', target_packages.target"
|
||||
(if include-builds?
|
||||
",
|
||||
(
|
||||
|
|
@ -386,7 +385,6 @@ FROM base_packages
|
|||
FULL OUTER JOIN target_packages
|
||||
ON base_packages.name = target_packages.name
|
||||
AND base_packages.version = target_packages.version
|
||||
AND base_packages.system = target_packages.system
|
||||
AND base_packages.target = target_packages.target
|
||||
AND (
|
||||
(
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue