foxfiles/db/migration.sql

20 lines
553 B
MySQL
Raw Normal View History

2024-02-01 21:32:10 +01:00
CREATE TABLE users (
id INTEGER PRIMARY KEY,
username TEXT UNIQUE NOT NULL,
password TEXT NOT NULL,
salt TEXT NOT NULL
role TEXT NOT NULL,
created_at TEXT NOT NULL DEFAULT (datetime()),
created_at TEXT NOT NULL DEFAULT (datetime())
);
CREATE TABLE files (
id INTEGER PRIMARY KEY,
user_id INTEGER NOT NULL REFERENCES users (id) ON DELETE CASCADE,
filename TEXT NOT NULL,
hash TEXT NOT NULL UNIQUE,
content_type TEXT NOT NULL,
size INTEGER NOT NULL
);