19 lines
407 B
SQL
19 lines
407 B
SQL
CREATE TABLE users (
|
|
email TEXT PRIMARY KEY,
|
|
token TEXT UNIQUE,
|
|
registered boolean DEFAULT false,
|
|
requested TIMESTAMP NOT NULL DEFAULT NOW()
|
|
);
|
|
|
|
CREATE TABLE namespaces (
|
|
ns TEXT PRIMARY KEY,
|
|
email TEXT REFERENCES users(email) ON DELETE CASCADE
|
|
);
|
|
|
|
CREATE TABLE packages (
|
|
vcs TEXT,
|
|
repo TEXT,
|
|
path TEXT UNIQUE,
|
|
ns TEXT REFERENCES namespaces(ns) ON DELETE CASCADE
|
|
);
|