Update
This commit is contained in:
parent
f13c9c905f
commit
f614e606f4
15 changed files with 269 additions and 214 deletions
|
@ -121,6 +121,14 @@ CREATE TABLE substitution_queries(
|
|||
|
||||
CREATE INDEX substitution_queries_active ON substitution_queries(active);
|
||||
|
||||
CREATE TABLE substitution_query_results(
|
||||
id SERIAL PRIMARY KEY,
|
||||
substitution_query_id INTEGER NOT NULL REFERENCES substitution_queries(id),
|
||||
queried_at TIMESTAMP NOT NULL,
|
||||
created_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
|
||||
updated_at TIMESTAMP
|
||||
);
|
||||
|
||||
CREATE TYPE substitution_type AS ENUM (
|
||||
'cancel',
|
||||
'subst',
|
||||
|
@ -141,7 +149,7 @@ CREATE TYPE substitution_type AS ENUM (
|
|||
|
||||
CREATE TABLE substitutions(
|
||||
id SERIAL PRIMARY KEY,
|
||||
substitution_query_id INTEGER NOT NULL REFERENCES substitution_queries(id),
|
||||
substitution_query_result_id INTEGER NOT NULL REFERENCES substitution_query_results(id),
|
||||
subst_type substitution_type NOT NULL,
|
||||
lesson_id INTEGER NOT NULL,
|
||||
start_time TIME NOT NULL,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue