You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
18 lines
528 B
SQL
18 lines
528 B
SQL
CREATE TABLE IF NOT EXISTS file_stats(
|
|
id BIGINT PRIMARY KEY,
|
|
num BIGINT NOT NULL,
|
|
size_b BIGINT NOT NULL
|
|
);
|
|
|
|
CREATE TABLE IF NOT EXISTS namespace(
|
|
id BIGINT PRIMARY KEY,
|
|
name TEXT NOT NULL UNIQUE,
|
|
lastseen BIGINT NOT NULL,
|
|
allowance_time BIGINT,
|
|
quota_kb BIGINT,
|
|
quota_usage_kb BIGINT,
|
|
usage_id BIGINT NOT NULL REFERENCES file_stats(Id) ON DELETE CASCADE,
|
|
download_id BIGINT NOT NULL REFERENCES file_stats(Id) ON DELETE CASCADE,
|
|
upload_id BIGINT NOT NULL REFERENCES file_stats(Id) ON DELETE CASCADE
|
|
);
|