summaryrefslogtreecommitdiff
path: root/src/sql/section_upsert.sql
diff options
context:
space:
mode:
authorJonathan Bradley <jcb@pikum.xyz>2025-10-13 15:27:59 -0400
committerJonathan Bradley <jcb@pikum.xyz>2025-10-13 15:44:17 -0400
commit6d53452ebc24287a72eedb9a2cc3f9e21c55362c (patch)
tree04ce0135a9718c41f24f217b587088dd9d59241a /src/sql/section_upsert.sql
parent62dae6011db94dd52c3ac0fce517c6e9cc0abcf6 (diff)
pke-at: second-pass sql storage
Diffstat (limited to 'src/sql/section_upsert.sql')
-rw-r--r--src/sql/section_upsert.sql9
1 files changed, 4 insertions, 5 deletions
diff --git a/src/sql/section_upsert.sql b/src/sql/section_upsert.sql
index 4ca1025..659d66a 100644
--- a/src/sql/section_upsert.sql
+++ b/src/sql/section_upsert.sql
@@ -1,10 +1,9 @@
-INSERT INTO [at_section] (uuid,section_type,sequence,beats_per_bar,bar_count)
- VALUES('%s','%s','%s','%s','%s')
- ON CONFLICT(uuid) DO UPDATE SET
+INSERT INTO [at_section] (uuid,sequence,section_type,beats_per_bar,bar_count)
+ VALUES('%s','%i','%u','%u','%u')
+ ON CONFLICT(song_uuid,sequence) DO UPDATE SET
section_type=excluded.section_type
- ,sequence=excluded.sequence
,beats_per_bar=excluded.beats_per_bar
,bar_count=excluded.bar_count
,is_deleted=0
,modification_dt=unixepoch('now')
- WHERE uuid=excluded.uuid;
+ WHERE song_uuid=excluded.uuid AND sequence=excluded.sequence;