28 lines
663 B
MySQL
28 lines
663 B
MySQL
|
|
||
|
|
||
|
CREATE TABLE accounts (
|
||
|
email TEXT PRIMARY KEY NOT NULL,
|
||
|
);
|
||
|
|
||
|
CREATE TABLE vms (
|
||
|
id TEXT PRIMARY KEY NOT NULL,
|
||
|
email TEXT REFERENCES accounts(email) ON DELETE RESTRICT,
|
||
|
created TIMESTAMP NOT NULL,
|
||
|
deleted TIMESTAMP NOT NULL,
|
||
|
);
|
||
|
|
||
|
CREATE TABLE payments (
|
||
|
email TEXT REFERENCES accounts(email) ON DELETE RESTRICT,
|
||
|
created TIMESTAMP NOT NULL,
|
||
|
dollars INTEGER NOT NULL,
|
||
|
PRIMARY KEY (email, created)
|
||
|
);
|
||
|
|
||
|
CREATE TABLE logintokens (
|
||
|
email TEXT REFERENCES accounts(email) ON DELETE RESTRICT,
|
||
|
created TIMESTAMP NOT NULL,
|
||
|
token TEXT NOT NULL,
|
||
|
PRIMARY KEY (email, created)
|
||
|
);
|
||
|
|
||
|
UPDATE schemaversion SET version = 2;
|