Make a big amalgamation of HTTP, WL, sqlite alongside cweb

This commit is contained in:
2025-09-24 10:51:12 +02:00
parent 0790a11b00
commit f2d5eef6d2
23 changed files with 275535 additions and 361 deletions
+29
View File
@@ -0,0 +1,29 @@
CREATE TABLE IF NOT EXISTS Users (
id INTEGER PRIMARY KEY,
username TEXT NOT NULL UNIQUE,
hash TEXT NOT NULL,
email TEXT NOT NULL UNIQUE,
signup_time DATETIME DEFAULT CURRENT_TIMESTAMP
);
CREATE TABLE IF NOT EXISTS Posts (
id INTEGER PRIMARY KEY,
author INTEGER NOT NULL,
title TEXT NOT NULL,
is_link BOOLEAN NOT NULL,
content TEXT NOT NULL,
submit_time DATETIME DEFAULT CURRENT_TIMESTAMP,
FOREIGN KEY (author) REFERENCES Users(id)
);
CREATE TABLE IF NOT EXISTS Comments (
id INTEGER PRIMARY KEY,
parent_post INTEGER NOT NULL,
parent_comment INTEGER,
author INTEGER NOT NULL,
content TEXT NOT NULL,
submit_time DATETIME DEFAULT CURRENT_TIMESTAMP,
FOREIGN KEY (author) REFERENCES Users(id),
FOREIGN KEY (parent_post) REFERENCES Posts(id),
FOREIGN KEY (parent_comment) REFERENCES Comments(id)
);