From 7a9e229d5f4913d1a48c92615bcb3234f5dcfd33 Mon Sep 17 00:00:00 2001
From: Benedikt Peetz <benedikt.peetz@b-peetz.de>
Date: Thu, 11 Jun 2026 01:05:07 +0200
Subject: chore: Restore db migrations

---
 .../server-sqlite-migrations/20240621110730_create-users.sql | 12 ++++++++++++
 1 file changed, 12 insertions(+)
 create mode 100644 crates/turtle/db/server-sqlite-migrations/20240621110730_create-users.sql

(limited to 'crates/turtle/db/server-sqlite-migrations/20240621110730_create-users.sql')

diff --git a/crates/turtle/db/server-sqlite-migrations/20240621110730_create-users.sql b/crates/turtle/db/server-sqlite-migrations/20240621110730_create-users.sql
new file mode 100644
index 00000000..852c159d
--- /dev/null
+++ b/crates/turtle/db/server-sqlite-migrations/20240621110730_create-users.sql
@@ -0,0 +1,12 @@
+create table users (
+	id integer primary key autoincrement,               -- also store our own ID
+	username text not null unique,   -- being able to contact users is useful
+	email text not null unique,     -- being able to contact users is useful
+	password text not null unique,
+  created_at timestamp not null default (datetime('now','localtime')),
+  verified_at timestamp with time zone default null
+);
+
+-- the prior index is case sensitive :(
+CREATE UNIQUE INDEX email_unique_idx on users (LOWER(email));
+CREATE UNIQUE INDEX username_unique_idx on users (LOWER(username));
-- 
cgit v1.3.1

