initial working
This commit is contained in:
@@ -0,0 +1,24 @@
|
||||
-- Add migration script here
|
||||
CREATE TABLE teachers (
|
||||
id INTEGER PRIMARY KEY,
|
||||
ansprache TEXT NOT NULL,
|
||||
last_name TEXT NOT NULL,
|
||||
subject_id INTEGER NOT NULL,
|
||||
FOREIGN KEY(subject_id) REFERENCES subjects(id)
|
||||
);
|
||||
CREATE TABLE subjects (
|
||||
id INTEGER PRIMARY KEY,
|
||||
name TEXT NOT NULL
|
||||
);
|
||||
CREATE TABLE appointments (
|
||||
id INTEGER PRIMARY KEY,
|
||||
teacher_id INTEGER NOT NULL,
|
||||
slot_id INTEGER NOT NULL,
|
||||
FOREIGN KEY(teacher_id) REFERENCES teachers(id),
|
||||
FOREIGN KEY(slot_id) REFERENCES appointment_slots(id)
|
||||
);
|
||||
CREATE TABLE appointment_slots (
|
||||
id INTEGER PRIMARY KEY,
|
||||
start_time DATETIME NOT NULL,
|
||||
end_time DATETIME NOT NULL
|
||||
);
|
||||
@@ -0,0 +1,18 @@
|
||||
-- Add migration script here
|
||||
INSERT INTO subjects (name)
|
||||
VALUES ('Mathematik'),
|
||||
('Deutsch'),
|
||||
('Biologie/Chemie'),
|
||||
('Kunst');
|
||||
INSERT INTO teachers (ansprache, last_name, subject_id)
|
||||
VALUES ('Frau', 'Dessauer-Reiners', 2),
|
||||
('Frau', 'Grimrath', 3),
|
||||
('Frau', 'Junghans', 2),
|
||||
('Frau', 'Schilling', 1),
|
||||
('Herr', 'Kühl', 1),
|
||||
('Frau', 'Küng', 4),
|
||||
('Frau', 'Nöhring', 2),
|
||||
('Herr', 'Rudolf', 2),
|
||||
('Herr', 'Schad', 3),
|
||||
('Herr', 'Scholz', 2),
|
||||
('Frau', 'Stanutiu', 1);
|
||||
Reference in New Issue
Block a user