feat: start develop a comment logic

This commit is contained in:
d3m0k1d
2026-02-15 19:06:10 +03:00
parent 2c3e6578e9
commit 0eca2b1e68
7 changed files with 132 additions and 8 deletions

View File

@@ -7,7 +7,8 @@ CREATE TABLE IF NOT EXISTS posts(
published BOOLEAN DEFAULT 0,
content TEXT NOT NULL,
CREATED_AT DATETIME DEFAULT CURRENT_TIMESTAMP,
updated_at DATETIME
updated_at DATETIME,
tags TEXT
);
CREATE TABLE IF NOT EXISTS users(
@@ -17,4 +18,14 @@ CREATE TABLE IF NOT EXISTS users(
github_login TEXT,
avatar_url TEXT
);
CREATE TABLE IF NOT EXISTS comments(
id INTEGER PRIMARY KEY AUTOINCREMENT,
post_id INTEGER NOT NULL,
user_id INTEGER,
content TEXT NOT NULL,
created_at DATETIME DEFAULT CURRENT_TIMESTAMP,
FOREIGN KEY (post_id) REFERENCES posts(id),
FOREIGN KEY (user_id) REFERENCES users(id)
);
`