summaryrefslogtreecommitdiff
path: root/db
diff options
context:
space:
mode:
authorRicardo Wurmus <rekado@elephly.net>2022-12-19 14:49:05 +0100
committerRicardo Wurmus <rekado@elephly.net>2022-12-20 10:57:03 +0100
commit7d2cd1e7aa91d46ba1924213ee2199160cf5173b (patch)
tree01568c89e2972cc9b19f5df49b965f50a369c0ef /db
Hello world
Diffstat (limited to 'db')
-rw-r--r--db/migrations/0000-schema.sql20
1 files changed, 20 insertions, 0 deletions
diff --git a/db/migrations/0000-schema.sql b/db/migrations/0000-schema.sql
new file mode 100644
index 0000000..c7f58a4
--- /dev/null
+++ b/db/migrations/0000-schema.sql
@@ -0,0 +1,20 @@
+BEGIN TRANSACTION;
+
+CREATE TABLE migrations (
+ version TEXT NOT NULL
+);
+
+CREATE TABLE accounts (
+ name TEXT NOT NULL PRIMARY KEY
+ CHECK (length(name) >= 2),
+ password TEXT NOT NULL
+
+);
+
+CREATE TABLE followers (
+ target TEXT NOT NULL,
+ follower TEXT NOT NULL,
+ FOREIGN KEY(target) REFERENCES accounts(name)
+);
+
+COMMIT;