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