summaryrefslogtreecommitdiff
path: root/db/migrations/0000-schema.sql
blob: c7f58a4fb19b64b0ae79170f05e9e19182cfbc5f (about) (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
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;