Files
OHTU-German-learning-website/gradesa/data/migrations/00009_grammar_items.sql
T
Axel AdlercreutzandGitHub 8d106964f4 fix (#271)
* fix

* update requests

* fixes

* ssl

* fix test

* remove pgbouncer

* cleanup
2025-04-11 11:29:54 +03:00

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)
);