]> git.ipfire.org Git - location/libloc.git/commitdiff
importer: Ensure that we set timestamps in the announcements table
authorMichael Tremer <michael.tremer@ipfire.org>
Wed, 19 Jun 2024 09:36:26 +0000 (09:36 +0000)
committerMichael Tremer <michael.tremer@ipfire.org>
Wed, 19 Jun 2024 09:36:26 +0000 (09:36 +0000)
Otherwise aging out older announcements does not work.

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
src/scripts/location-importer.in

index c65029b42172718b3060859b6ca5bb76a7522d05..33613b71894f42d2ca700a5e7ce0f8f96447da9d 100644 (file)
@@ -199,6 +199,8 @@ class CLI(object):
                                CREATE UNIQUE INDEX IF NOT EXISTS announcements_networks ON announcements(network);
                                CREATE INDEX IF NOT EXISTS announcements_search2 ON announcements
                                        USING SPGIST(network inet_ops);
+                               ALTER TABLE announcements ALTER COLUMN first_seen_at SET NOT NULL;
+                               ALTER TABLE announcements ALTER COLUMN last_seen_at  SET NOT NULL;
 
                                -- autnums
                                CREATE TABLE IF NOT EXISTS autnums(number bigint, name text NOT NULL);