imgboard/migrations/20231018134946_init.sql

28 lines
693 B
MySQL
Raw Normal View History

2023-10-18 17:17:53 +02:00
CREATE TABLE users (
id SERIAL PRIMARY KEY,
username TEXT NOT NULL UNIQUE,
password TEXT NOT NULL,
2023-10-19 02:54:47 +02:00
role INTEGER NOT NULL,
2023-10-18 17:17:53 +02:00
created_at TIMESTAMPTZ NOT NULL DEFAULT now(),
last_active TIMESTAMPTZ NOT NULL DEFAULT now()
);
CREATE TABLE posts (
id SERIAL PRIMARY KEY,
tags TEXT NOT NULL DEFAULT '',
filename TEXT NOT NULL,
content_type TEXT NOT NULL,
hash TEXT NOT NULL,
size INTEGER NOT NULL,
source TEXT,
created_at TIMESTAMPTZ NOT NULL DEFAULT now()
);
CREATE TABLE tags (
id SERIAL PRIMARY KEY,
name TEXT NOT NULL UNIQUE,
2023-10-18 22:32:37 +02:00
description TEXT NOT NULL
2023-10-18 17:17:53 +02:00
);