diff --git a/meta/sqlite/sensor.go b/meta/sqlite/sensor.go index 33831f955..dad30fe90 100644 --- a/meta/sqlite/sensor.go +++ b/meta/sqlite/sensor.go @@ -365,7 +365,7 @@ END; var stream = Table{ Create: streamCreate, Insert: func() string { - return fmt.Sprintf("INSERT OR IGNORE INTO stream (site_id, band, source, sampling_rate, axial, reversed, triggered, start_date, end_date) VALUES ((%s), ?, ?, ?, ?, ?, ?, ?, ?);", + return fmt.Sprintf("INSERT INTO stream (site_id, band, source, sampling_rate, axial, reversed, triggered, start_date, end_date) VALUES ((%s), ?, ?, ?, ?, ?, ?, ?, ?);", site.Select(), ) }, @@ -403,8 +403,8 @@ END; var connection = Table{ Create: connectionCreate, Insert: func() string { - return fmt.Sprintf("INSERT OR IGNORE INTO connection (site_id, place_role_id, number, start_date, end_date) VALUES ((%s), (%s), ?, ?, ?);", - model.Select(), placeRole.Select(), + return fmt.Sprintf("INSERT INTO connection (site_id, place_role_id, number, start_date, end_date) VALUES ((%s), (%s), ?, ?, ?);", + site.Select(), placeRole.Select(), ) }, Fields: []string{"Station", "Location", "Place", "Role", "Number", "Start Date", "End Date"}, @@ -425,7 +425,7 @@ var placeRole = Table{ return "SELECT place_role_id FROM place_role WHERE place = ? AND role = ?" }, Insert: func() string { - return "INSERT OR IGNORE INTO place_role (place, role) VALUES (?, ?);" + return "INSERT INTO place_role (place, role) VALUES (?, ?) ON CONFLICT(place, role) DO NOTHING;" }, Fields: []string{"Place", "Role"}, }