From b124169f49b336534f83e076374a0e3f866339a7 Mon Sep 17 00:00:00 2001 From: Manuel Carrer Date: Mon, 28 Oct 2024 14:00:47 +0100 Subject: [PATCH] Don't insert KDVHFlag --- db/flags.sql | 2 +- migrations/kdvh/import_functions.go | 6 ------ migrations/kdvh/{kdvh_test.go => import_test.go} | 0 migrations/lard/main.go | 8 ++++++-- 4 files changed, 7 insertions(+), 9 deletions(-) rename migrations/kdvh/{kdvh_test.go => import_test.go} (100%) diff --git a/db/flags.sql b/db/flags.sql index d6956826..0c7fe748 100644 --- a/db/flags.sql +++ b/db/flags.sql @@ -21,7 +21,7 @@ CREATE TABLE IF NOT EXISTS flags.kdvh ( obstime TIMESTAMPTZ NOT NULL, controlinfo TEXT NULL, useinfo TEXT NULL, - -- kvdhflags TEXT NULL, -- What is this and should we store it? + -- kdvhflag TEXT NULL, CONSTRAINT unique_kdvh_timeseries_obstime UNIQUE (timeseries, obstime) ); diff --git a/migrations/kdvh/import_functions.go b/migrations/kdvh/import_functions.go index a331ddd2..0426e512 100644 --- a/migrations/kdvh/import_functions.go +++ b/migrations/kdvh/import_functions.go @@ -271,7 +271,6 @@ func makeDataPage(obs Obs) (lard.Obs, error) { NonScalarData: nonscalar, KVFlagUseInfo: useinfo, KVFlagControlInfo: controlinfo, - KDVHFlag: obs.Flags, }, nil } @@ -318,7 +317,6 @@ func makeDataPageEdata(obs Obs) (lard.Obs, error) { Data: valPtr, KVFlagUseInfo: useinfo, KVFlagControlInfo: controlinfo, - KDVHFlag: obs.Flags, }, nil } @@ -375,7 +373,6 @@ func makeDataPagePdata(obs Obs) (lard.Obs, error) { Data: valPtr, KVFlagUseInfo: useinfo, KVFlagControlInfo: controlinfo, - KDVHFlag: obs.Flags, }, nil } @@ -442,7 +439,6 @@ func makeDataPageNdata(obs Obs) (lard.Obs, error) { Data: valPtr, KVFlagUseInfo: useinfo, KVFlagControlInfo: controlinfo, - KDVHFlag: obs.Flags, }, nil } @@ -488,7 +484,6 @@ func makeDataPageVdata(obs Obs) (lard.Obs, error) { Data: valPtr, KVFlagUseInfo: useinfo, KVFlagControlInfo: controlinfo, - KDVHFlag: obs.Flags, }, nil } @@ -504,7 +499,6 @@ func makeDataPageDiurnalInterpolated(obs Obs) (lard.Obs, error) { Data: &val, KVFlagUseInfo: DIURNAL_INTERPOLATED_USEINFO, KVFlagControlInfo: VALUE_MANUALLY_INTERPOLATED, - KDVHFlag: obs.Flags, }, nil } diff --git a/migrations/kdvh/kdvh_test.go b/migrations/kdvh/import_test.go similarity index 100% rename from migrations/kdvh/kdvh_test.go rename to migrations/kdvh/import_test.go diff --git a/migrations/lard/main.go b/migrations/lard/main.go index 763e74c1..81e44c20 100644 --- a/migrations/lard/main.go +++ b/migrations/lard/main.go @@ -16,8 +16,12 @@ type Obs struct { KVFlagControlInfo string // Flag encoding quality control status KVFlagUseInfo string - // Subset of 5 digits of KVFlagUseInfo stored in KDVH - KDVHFlag string + + // 5 digit flag stored in KDVH + // TODO: these are the first 5 digits in KVFlagUseInfo + // I don't see a point in storing them separately? + // KDVHFlag string + // Comma separated value listing checks that failed during quality control // KVCheckFailed string }