summaryrefslogtreecommitdiff
path: root/storage/migrations
diff options
context:
space:
mode:
authorGrail Finder <wohilas@gmail.com>2024-11-19 17:15:02 +0300
committerGrail Finder <wohilas@gmail.com>2024-11-19 17:15:02 +0300
commitf32375488f5127c910021f627d83e017c5c7a10f (patch)
tree5a697ca8a42e3651fa57ea346af223b67f3e3a3a /storage/migrations
parentd3cc8774b13a0c8e9fbf11947b9caca216595a8d (diff)
Feat: add storage interface; add sqlite impl
Diffstat (limited to 'storage/migrations')
-rw-r--r--storage/migrations/001_init.down.sql1
-rw-r--r--storage/migrations/001_init.up.sql7
2 files changed, 8 insertions, 0 deletions
diff --git a/storage/migrations/001_init.down.sql b/storage/migrations/001_init.down.sql
new file mode 100644
index 0000000..0ef183f
--- /dev/null
+++ b/storage/migrations/001_init.down.sql
@@ -0,0 +1 @@
+DROP TABLE IF EXISTS chat;
diff --git a/storage/migrations/001_init.up.sql b/storage/migrations/001_init.up.sql
new file mode 100644
index 0000000..287f3d1
--- /dev/null
+++ b/storage/migrations/001_init.up.sql
@@ -0,0 +1,7 @@
+CREATE TABLE chat (
+ id INTEGER PRIMARY KEY AUTOINCREMENT,
+ name TEXT NOT NULL,
+ msgs TEXT NOT NULL, -- Store messages as a comma-separated string
+ created_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
+ updated_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP
+);