From da8d1d4c6767b7e5c1906e9734c00f66effb5cc7 Mon Sep 17 00:00:00 2001 From: Clemens Zagler Date: Tue, 29 Oct 2024 16:03:55 +0100 Subject: [PATCH] db migration script for new fields and restructuring indexes --- a22db.migration.sql | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 a22db.migration.sql diff --git a/a22db.migration.sql b/a22db.migration.sql new file mode 100644 index 0000000..1c21819 --- /dev/null +++ b/a22db.migration.sql @@ -0,0 +1,13 @@ +-- SPDX-FileCopyrightText: 2024 NOI Techpark +-- +-- SPDX-License-Identifier: CC0-1.0 + +alter table a22.a22_traffic add country int2; +alter table a22.a22_traffic add license_plate_initials text; + +drop index if exists a22.a22_traffic_stationcode_ix; +drop index if exists a22.a22_recent_data_ix_ccnew; +CREATE INDEX a22_recent_data_ix_ccnew +ON a22.a22_traffic USING btree (stationcode, "timestamp" DESC) WHERE ("timestamp" > 1728005677); +drop index if exists a22.a22_recent2_data_ix; +