summaryrefslogtreecommitdiff
path: root/db/migrations/0000-schema.sql
diff options
context:
space:
mode:
Diffstat (limited to 'db/migrations/0000-schema.sql')
-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;