icebox/sql/setup.sql

24 lines
437 B
SQL

CREATE TABLE IF NOT EXISTS files {
id TEXT PRIMARY KEY,
filename TEXT,
original TEXT,
archive TEXT,
paths TEXT,
hash TEXT,
size INTEGER,
created INTEGER,
created_str TEXT
};
CREATE TABLE IF NOT EXISTS access {
id TEXT PRIMARY KEY,
file TEXT REFERENCES files(id),
created INTEGER,
created_str TEXT,
expires INTEGER,
expires_str TEXT,
paid INTEGER DEFAULT 0,
url TEXT UNIQUE,
service TEXT,
downloads INTEGER DEFAULT 0
}