aboutsummaryrefslogtreecommitdiff
path: root/tests/model-license.scm
diff options
context:
space:
mode:
authorChristopher Baines <mail@cbaines.net>2019-08-04 09:39:40 +0100
committerChristopher Baines <mail@cbaines.net>2019-08-04 09:39:40 +0100
commit84197686ce227b21dae48745f2919a51e070c3c5 (patch)
tree0ed4cc11138628575e490b803e766e8749a337d6 /tests/model-license.scm
parent1724bc485f13922d768bc09309a6a7975678c321 (diff)
downloaddata-service-84197686ce227b21dae48745f2919a51e070c3c5.tar
data-service-84197686ce227b21dae48745f2919a51e070c3c5.tar.gz
Fix some duplicated values in tables
The licenses table, along with the package_metadata table had duplicate values. This could happen as the unique constraints on those tables didn't properly account for the nullable fields. The duplicates in those tables also affected the license_sets, packages, package_derivations tables in a similar way. Finally, the guix_revision_package_derivations table was also affected. This commit adds a migration to fix the data, as well as the constraints. THe code to populate the licenses and package_metadata tables is also updated.
Diffstat (limited to 'tests/model-license.scm')
-rw-r--r--tests/model-license.scm7
1 files changed, 5 insertions, 2 deletions
diff --git a/tests/model-license.scm b/tests/model-license.scm
index 7888117..8f4b0c3 100644
--- a/tests/model-license.scm
+++ b/tests/model-license.scm
@@ -17,10 +17,13 @@
"https://example.com/why-license-1"))
(("License 1"
"https://gnu.org/licenses/test-1.html"
- "https://example.com/why-license-1")
+ #f)
("License 2"
"https://gnu.org/licenses/test-2.html"
- "https://example.com/why-license-2")))))
+ #f)
+ ("License 3"
+ #f
+ #f)))))
(with-postgresql-connection
"test-model-license"