From 62dae6011db94dd52c3ac0fce517c6e9cc0abcf6 Mon Sep 17 00:00:00 2001
From: Jonathan Bradley <jcb@pikum.xyz>
Date: Fri, 10 Oct 2025 17:07:45 -0400
Subject: pke-at: first-pass storage interface

---
 src/sql/schema-000-000.sql | 48 ++++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 48 insertions(+)
 create mode 100644 src/sql/schema-000-000.sql

(limited to 'src/sql/schema-000-000.sql')

diff --git a/src/sql/schema-000-000.sql b/src/sql/schema-000-000.sql
new file mode 100644
index 0000000..f80977f
--- /dev/null
+++ b/src/sql/schema-000-000.sql
@@ -0,0 +1,48 @@
+CREATE TABLE [db_version] (
+	id INTEGER PRIMARY KEY
+	,version_maj INTEGER NOT NULL
+	,version_min INTEGER NOT NULL
+	,is_deleted INTEGER NOT NULL DEFAULT 0
+	,creation_dt INTEGER DEFAULT (unixepoch('now'))
+	,modification_dt INTEGER DEFAULT (unixepoch('now'))
+);
+
+CREATE TABLE [at_setlist] (
+	uuid BLOB PRIMARY KEY
+	,title nvarchar(128) DEFAULT ''
+	,is_deleted INTEGER NOT NULL DEFAULT 0
+	,creation_dt INTEGER DEFAULT (unixepoch('now'))
+	,modification_dt INTEGER DEFAULT (unixepoch('now'))
+);
+
+CREATE TABLE [at_song] (
+	uuid BLOB PRIMARY KEY
+	,ccli INTEGER
+	,title nvarchar(128) DEFAULT ''
+	,arrangement nvarchar(128) DEFAULT ''
+	,beats_per_minute INTEGER
+	,is_deleted INTEGER NOT NULL DEFAULT 0
+	,creation_dt INTEGER DEFAULT (unixepoch('now'))
+	,modification_dt INTEGER DEFAULT (unixepoch('now'))
+);
+
+CREATE TABLE [at_setlist_song] (
+	setlist_uuid BLOB
+	,song_uuid BLOB
+	,is_deleted INTEGER NOT NULL DEFAULT 0
+	,creation_dt INTEGER DEFAULT (unixepoch('now'))
+	,modification_dt INTEGER DEFAULT (unixepoch('now'))
+);
+
+CREATE TABLE [at_section] (
+	song_uuid BLOB
+	,section_type INTEGER
+	,sequence INTEGER
+	,beats_per_bar INTEGER
+	,bar_count INTEGER
+	,is_deleted INTEGER NOT NULL DEFAULT 0
+	,creation_dt INTEGER DEFAULT (unixepoch('now'))
+	,modification_dt INTEGER DEFAULT (unixepoch('now'))
+);
+
+INSERT INTO [db_version](id,version_maj,version_min) VALUES(0,1,0);
-- 
cgit v1.2.3

