mirror of
https://github.com/OHTU-German-learning-website/OHTU-German-learning-website.git
synced 2026-10-12 19:13:51 +03:00
* fix * update requests * fixes * ssl * fix test * remove pgbouncer * cleanup
15 lines
469 B
SQL
15 lines
469 B
SQL
CREATE TABLE grammar_items (
|
|
id bigint PRIMARY KEY NOT NULL GENERATED BY DEFAULT AS IDENTITY,
|
|
grammar_item TEXT NOT NULL,
|
|
UNIQUE (grammar_item)
|
|
);
|
|
|
|
-- Table that joins grammar items and exercises
|
|
CREATE TABLE exercises_to_grammar_items (
|
|
id bigint PRIMARY KEY NOT NULL GENERATED BY DEFAULT AS IDENTITY,
|
|
grammar_item_id bigint,
|
|
exercise_id bigint,
|
|
FOREIGN KEY (grammar_item_id) REFERENCES grammar_items(id),
|
|
FOREIGN KEY (exercise_id) REFERENCES exercises(id)
|
|
);
|