From d0337f2b16b11604178816d5da99c91479433be5 Mon Sep 17 00:00:00 2001 From: Mark Chadwick Date: Sat, 23 Nov 2024 19:35:05 +1300 Subject: [PATCH] update --- meta/sqlite/gauge.go | 6 +++--- meta/sqlite/mount.go | 6 +++--- meta/sqlite/receiver.go | 10 +++++----- meta/sqlite/sensor.go | 6 +++--- 4 files changed, 14 insertions(+), 14 deletions(-) diff --git a/meta/sqlite/gauge.go b/meta/sqlite/gauge.go index 24221d1c8..6fa5e78e2 100644 --- a/meta/sqlite/gauge.go +++ b/meta/sqlite/gauge.go @@ -26,7 +26,7 @@ var gauge = Table{ return "SELECT gauge_id FROM gauge WHERE gauge = ?" }, Insert: func() string { - return "INSERT OR IGNORE INTO gauge (gauge, identification_number, analysis_time_zone, analysis_latitude, analysis_longitude, crex_tag, start_date, end_date) VALUES (?, ?, ?, ?, ?, ?, ?, ?);" + return "INSERT INTO gauge (gauge, identification_number, analysis_time_zone, analysis_latitude, analysis_longitude, crex_tag, start_date, end_date) VALUES (?, ?, ?, ?, ?, ?, ?, ?);" }, Fields: []string{"Gauge", "Identification Number", "Analysis Time Zone", "Analysis Latitude", "Analysis Longitude", "Crex Tag", "Start Date", "End Date"}, } @@ -61,7 +61,7 @@ END; var constituent = Table{ Create: constituentCreate, Insert: func() string { - return fmt.Sprintf("INSERT OR IGNORE INTO constituent (gauge, number, constituent, amplitude, lag, start_date, end_date) VALUES ((%s), ?, ?, ?, ?, ?, ?);", + return fmt.Sprintf("INSERT INTO constituent (gauge, number, constituent, amplitude, lag, start_date, end_date) VALUES ((%s), ?, ?, ?, ?, ?, ?);", gauge.Select(), ) }, @@ -95,7 +95,7 @@ END; var dart = Table{ Create: dartCreate, Insert: func() string { - return fmt.Sprintf("INSERT OR IGNORE INTO dart (station_id, pid, wmo_identifier, start_date, end_date) VALUES ((%s), ?, ?, ?, ?);", station.Select()) + return fmt.Sprintf("INSERT INTO dart (station_id, pid, wmo_identifier, start_date, end_date) VALUES ((%s), ?, ?, ?, ?);", station.Select()) }, Fields: []string{"Station", "Pid", "WMO Identifier", "Start Date", "End Date"}, } diff --git a/meta/sqlite/mount.go b/meta/sqlite/mount.go index 79dbf12c5..d2e0cb6a3 100644 --- a/meta/sqlite/mount.go +++ b/meta/sqlite/mount.go @@ -28,7 +28,7 @@ var mount = Table{ return "SELECT mount_id FROM mount WHERE mount = ?" }, Insert: func() string { - return fmt.Sprintf("INSERT OR IGNORE INTO mount (datum_id, mount, name, latitude, longitude, elevation, description, start_date, end_date) VALUES ((%s), ?, ?, ?, ?, ?, ?, ?, ?);", + return fmt.Sprintf("INSERT INTO mount (datum_id, mount, name, latitude, longitude, elevation, description, start_date, end_date) VALUES ((%s), ?, ?, ?, ?, ?, ?, ?, ?);", datum.Select(), ) }, @@ -54,7 +54,7 @@ var mountNetwork = Table{ ) }, Insert: func() string { - return fmt.Sprintf("INSERT OR IGNORE INTO mount_network (mount_id, network_id) VALUES ((%s), (%s));", + return fmt.Sprintf("INSERT INTO mount_network (mount_id, network_id) VALUES ((%s), (%s));", mount.Select(), network.Select()) }, @@ -108,7 +108,7 @@ var view = Table{ ) }, Insert: func() string { - return fmt.Sprintf("INSERT OR IGNORE INTO view (mount_id, view, label, azimuth, dip, method, description, start_date, end_date) VALUES ((%s), ?, ?, ?, ?, ?, ?, ?, ?);", + return fmt.Sprintf("INSERT INTO view (mount_id, view, label, azimuth, dip, method, description, start_date, end_date) VALUES ((%s), ?, ?, ?, ?, ?, ?, ?, ?);", mount.Select(), ) }, diff --git a/meta/sqlite/receiver.go b/meta/sqlite/receiver.go index 13014555a..8a8703dd5 100644 --- a/meta/sqlite/receiver.go +++ b/meta/sqlite/receiver.go @@ -36,7 +36,7 @@ END; var antenna = Table{ Create: antennaCreate, Insert: func() string { - return fmt.Sprintf("INSERT OR IGNORE INTO antenna (asset_id, mark_id, height, north, east, azimuth, start_date, end_date) VALUES ((%s), (%s), ?, ?, ?, ?, ?, ?);", + return fmt.Sprintf("INSERT INTO antenna (asset_id, mark_id, height, north, east, azimuth, start_date, end_date) VALUES ((%s), (%s), ?, ?, ?, ?, ?, ?);", asset.Select(), mark.Select(), ) }, @@ -80,7 +80,7 @@ END; var metsensor = Table{ Create: metsensorCreate, Insert: func() string { - return fmt.Sprintf("INSERT OR IGNORE INTO metsensor (asset_id, mark_id, datum_id, ims_comment, humidity, pressure, temperature, latitude, longitude, elevation, start_date, end_date) VALUES ((%s), (%s), (%s), ?, ?, ?, ?, ?, ?, ?, ?, ?);", + return fmt.Sprintf("INSERT INTO metsensor (asset_id, mark_id, datum_id, ims_comment, humidity, pressure, temperature, latitude, longitude, elevation, start_date, end_date) VALUES ((%s), (%s), (%s), ?, ?, ?, ?, ?, ?, ?, ?, ?);", asset.Select(), mark.Select(), datum.Select(), ) }, @@ -115,7 +115,7 @@ END; var radome = Table{ Create: radomeCreate, Insert: func() string { - return fmt.Sprintf("INSERT OR IGNORE INTO radome (asset_id, mark_id, start_date, end_date) VALUES ((%s), (%s), ?, ?);", + return fmt.Sprintf("INSERT INTO radome (asset_id, mark_id, start_date, end_date) VALUES ((%s), (%s), ?, ?);", asset.Select(), mark.Select(), ) }, @@ -150,7 +150,7 @@ END; var receiver = Table{ Create: receiverCreate, Insert: func() string { - return fmt.Sprintf("INSERT OR IGNORE INTO receiver (asset_id, mark_id, start_date, end_date) VALUES ((%s), (%s), ?, ?);", + return fmt.Sprintf("INSERT INTO receiver (asset_id, mark_id, start_date, end_date) VALUES ((%s), (%s), ?, ?);", asset.Select(), mark.Select(), ) }, @@ -192,7 +192,7 @@ END; var session = Table{ Create: sessionCreate, Insert: func() string { - return fmt.Sprintf("INSERT OR IGNORE INTO session (mark_id, operator, agency, model, satellite, interval, elevation_mask, header_comment, format, start_date, end_date) VALUES ((%s), ?, ?, ?, ?, ?, ?, ?, ?, ?, ?);", + return fmt.Sprintf("INSERT INTO session (mark_id, operator, agency, model, satellite, interval, elevation_mask, header_comment, format, start_date, end_date) VALUES ((%s), ?, ?, ?, ?, ?, ?, ?, ?, ?, ?);", mark.Select(), ) }, diff --git a/meta/sqlite/sensor.go b/meta/sqlite/sensor.go index dff48b649..8ada01830 100644 --- a/meta/sqlite/sensor.go +++ b/meta/sqlite/sensor.go @@ -270,7 +270,7 @@ END; var sensor = Table{ Create: sensorCreate, Insert: func() string { - return fmt.Sprintf("INSERT OR IGNORE INTO sensor (asset_id, site_id, method_id, azimuth, dip, depth, north, east, scale_factor, scale_bias, start_date, end_date) VALUES ((%s), (%s), (%s), ?, ?, ?, ?, ?, ?, ?, ?, ?);", + return fmt.Sprintf("INSERT INTO sensor (asset_id, site_id, method_id, azimuth, dip, depth, north, east, scale_factor, scale_bias, start_date, end_date) VALUES ((%s), (%s), (%s), ?, ?, ?, ?, ?, ?, ?, ?, ?);", asset.Select(), site.Select(), method.Select(), ) }, @@ -316,7 +316,7 @@ END; var recorder = Table{ Create: recorderCreate, Insert: func() string { - return fmt.Sprintf("INSERT OR IGNORE INTO recorder (asset_id, model_id, site_id, method_id, azimuth, dip, depth, start_date, end_date) VALUES ((%s), (%s), (%s), (%s), ?, ?, ?, ?, ?);", + return fmt.Sprintf("INSERT INTO recorder (asset_id, model_id, site_id, method_id, azimuth, dip, depth, start_date, end_date) VALUES ((%s), (%s), (%s), (%s), ?, ?, ?, ?, ?);", asset.Select(), model.Select(), site.Select(), method.Select(), ) }, @@ -325,7 +325,7 @@ var recorder = Table{ var recorderModel = Table{ Insert: func() string { - return fmt.Sprintf("INSERT OR IGNORE INTO model (make_id, model) VALUES ((%s), ?);", + return fmt.Sprintf("INSERT INTO model (make_id, model) VALUES ((%s), ?) ON CONFLICT(make_id, model) DO NOTHING;", mmake.Select(), ) },