From 6e069484cb0a911ba541e07bf04331fadbb76612 Mon Sep 17 00:00:00 2001
From: Julien Dessaux
Date: Mon, 6 Jan 2025 00:41:32 +0100
Subject: feat(webui): bootstrap session handling and login process

---
 pkg/database/sql/000_init.sql | 9 +++++++++
 1 file changed, 9 insertions(+)

(limited to 'pkg/database/sql/000_init.sql')

diff --git a/pkg/database/sql/000_init.sql b/pkg/database/sql/000_init.sql
index b635442..e14142b 100644
--- a/pkg/database/sql/000_init.sql
+++ b/pkg/database/sql/000_init.sql
@@ -14,6 +14,15 @@ CREATE TABLE accounts (
 ) STRICT;
 CREATE UNIQUE INDEX accounts_username on accounts(username);
 
+CREATE TABLE sessions (
+  id TEXT PRIMARY KEY,
+  account_id INTEGER NOT NULL,
+  created INTEGER NOT NULL DEFAULT (unixepoch()),
+  updated INTEGER NOT NULL DEFAULT (unixepoch()),
+  data TEXT NOT NULL,
+  FOREIGN KEY(account_id) REFERENCES accounts(id) ON DELETE CASCADE
+) STRICT;
+
 CREATE TABLE states (
   id INTEGER PRIMARY KEY,
   path TEXT NOT NULL,
-- 
cgit v1.2.3

