fix postgres duration queries to return expected integer type
authorJustin Wind <justin.wind+git@gmail.com>
Sat, 30 Jul 2022 17:35:24 +0000 (10:35 -0700)
committerJustin Wind <justin.wind+git@gmail.com>
Sat, 30 Jul 2022 17:35:24 +0000 (10:35 -0700)
src/db/postgres/sql/topic-get-by-id.sql
src/db/postgres/sql/topic-get-by-url.sql
src/db/postgres/sql/topic-get-content-by-id.sql
src/db/postgres/sql/topic-get-info-all.sql

index 598b6756b83f3dffe44079ab84d95463cd585696..71d36ed1ac8e93eb6616a1597029947e42665542 100644 (file)
@@ -3,9 +3,9 @@ SELECT
        id,
        created,
        url,
-       extract(epoch FROM lease_seconds_preferred) AS lease_seconds_preferred,
-       extract(epoch FROM lease_seconds_min) AS lease_seconds_min,
-       extract(epoch FROM lease_seconds_max) AS lease_seconds_max,
+       extract(epoch FROM lease_seconds_preferred)::integer AS lease_seconds_preferred,
+       extract(epoch FROM lease_seconds_min)::integer AS lease_seconds_min,
+       extract(epoch FROM lease_seconds_max)::integer AS lease_seconds_max,
        publisher_validation_url,
        content_hash_algorithm,
        is_active,
index 13aa67c9373bf0c2f2b5c48aa44744ec18e80291..877c2a1720da377e09d5058491af65df95e0b992 100644 (file)
@@ -3,9 +3,9 @@ SELECT
        id,
        created,
        url,
-       extract(epoch FROM lease_seconds_preferred) AS lease_seconds_preferred,
-       extract(epoch FROM lease_seconds_min) AS lease_seconds_min,
-       extract(epoch FROM lease_seconds_max) AS lease_seconds_max,
+       extract(epoch FROM lease_seconds_preferred)::integer AS lease_seconds_preferred,
+       extract(epoch FROM lease_seconds_min)::integer AS lease_seconds_min,
+       extract(epoch FROM lease_seconds_max)::integer AS lease_seconds_max,
        publisher_validation_url,
        content_hash_algorithm,
        is_active,
index f60399180cadaff78be2f189451c3fcbb246d724..bafda951948c35f8c7fb405c00b32443d17cf651 100644 (file)
@@ -1,7 +1,7 @@
 -- topic including content
 SELECT *,
-       extract(epoch FROM lease_seconds_preferred) AS lease_seconds_preferred,
-       extract(epoch FROM lease_seconds_min) AS lease_seconds_min,
-       extract(epoch FROM lease_seconds_max) AS lease_seconds_max
+       extract(epoch FROM lease_seconds_preferred)::integer AS lease_seconds_preferred,
+       extract(epoch FROM lease_seconds_min)::integer AS lease_seconds_min,
+       extract(epoch FROM lease_seconds_max)::integer AS lease_seconds_max
 FROM topic
 WHERE id = $(topicId)
index e4289037e1097a0a0ef2394ce22c61f163e291bd..4d9aa0de069ee86185c5fd23479e4285effc6b47 100644 (file)
@@ -3,9 +3,9 @@ SELECT
        t.id,
        created,
        url,
-       extract(epoch FROM lease_seconds_preferred) AS lease_seconds_preferred,
-       extract(epoch FROM lease_seconds_min) AS lease_seconds_min,
-       extract(epoch FROM lease_seconds_max) AS lease_seconds_max,
+       extract(epoch FROM lease_seconds_preferred)::integer AS lease_seconds_preferred,
+       extract(epoch FROM lease_seconds_min)::integer AS lease_seconds_min,
+       extract(epoch FROM lease_seconds_max)::integer AS lease_seconds_max,
        t.publisher_validation_url,
        t.content_hash_algorithm,
        t.is_active,