This repository has been archived on 2025-04-28. You can view files and clone it, but cannot push or open issues or pull requests.
rust-web/migrations/0_init_schema.sql
2024-05-08 17:15:33 -07:00

21 lines
442 B
SQL

CREATE TABLE IF NOT EXISTS questions {
id PRIMARY KEY,
title TEXT NOT NULL,
content TEXT NOT NULL,
}
CREATE TABLE IF NOT EXISTS tags {
id PRIMARY KEY,
label TEXT NOT NULL,
}
CREATE TABLE IF NOT EXISTS question_tag {
question_id REFERENCES questions(id),
tag_id REFERENCES tags(id),
}
CREATE TABLE IF NOT EXISTS answers {
id PRIMARY KEY,
question_id REFERENCES questions(id),
content TEXT NOT NULL,
}