2024-12-17 03:22:56 +00:00
|
|
|
CREATE TABLE classroom_compliance_class (
|
|
|
|
id INTEGER PRIMARY KEY,
|
|
|
|
number INTEGER NOT NULL,
|
|
|
|
school_year TEXT NOT NULL,
|
|
|
|
user_id INTEGER NOT NULL REFERENCES user(id)
|
|
|
|
ON UPDATE CASCADE ON DELETE CASCADE
|
|
|
|
);
|
|
|
|
|
|
|
|
CREATE TABLE classroom_compliance_student (
|
|
|
|
id INTEGER PRIMARY KEY,
|
|
|
|
name TEXT NOT NULL,
|
|
|
|
class_id INTEGER NOT NULL REFERENCES classroom_compliance_class(id)
|
|
|
|
ON UPDATE CASCADE ON DELETE CASCADE,
|
2024-12-21 00:27:08 +00:00
|
|
|
desk_number INTEGER NOT NULL DEFAULT 0,
|
|
|
|
removed INTEGER NOT NULL DEFAULT 0
|
2024-12-17 03:22:56 +00:00
|
|
|
);
|
|
|
|
|
|
|
|
CREATE TABLE classroom_compliance_entry (
|
|
|
|
id INTEGER PRIMARY KEY,
|
|
|
|
class_id INTEGER NOT NULL REFERENCES classroom_compliance_class(id)
|
|
|
|
ON UPDATE CASCADE ON DELETE CASCADE,
|
2024-12-27 20:14:58 +00:00
|
|
|
student_id INTEGER NOT NULL REFERENCES classroom_compliance_student(id)
|
|
|
|
ON UPDATE CASCADE ON DELETE CASCADE,
|
2024-12-17 03:22:56 +00:00
|
|
|
date TEXT NOT NULL,
|
|
|
|
created_at INTEGER NOT NULL,
|
|
|
|
absent INTEGER NOT NULL DEFAULT 0
|
|
|
|
);
|
|
|
|
|
|
|
|
CREATE TABLE classroom_compliance_entry_phone (
|
|
|
|
entry_id INTEGER PRIMARY KEY REFERENCES classroom_compliance_entry(id)
|
|
|
|
ON UPDATE CASCADE ON DELETE CASCADE,
|
|
|
|
compliant INTEGER NOT NULL DEFAULT 1
|
|
|
|
);
|
|
|
|
|
|
|
|
CREATE TABLE classroom_compliance_entry_behavior (
|
|
|
|
entry_id INTEGER PRIMARY KEY REFERENCES classroom_compliance_entry(id)
|
|
|
|
ON UPDATE CASCADE ON DELETE CASCADE,
|
|
|
|
rating INTEGER NOT NULL,
|
|
|
|
comment TEXT
|
|
|
|
);
|