class CallSchedule(db.Model): id = db.Column(db.Integer, primary_key=True) school_id = db.Column(db.Integer, db.ForeignKey("school.id"), nullable=False) subject_number = db.Column(db.Integer, nullable=False, unique=False) start = db.Column(db.String(5), nullable=False, unique=False) end = db.Column(db.String(5), nullable=False, unique=False)
class Message(db.Model): id = db.Column(db.Integer, primary_key=True) sender_id = db.Column(db.Integer, nullable=False, unique=False) sender_role = db.Column(db.String(11), nullable=False, unique=False) recipient_role = db.Column(db.String(11), nullable=False, unique=False) recipient_id = db.Column(db.Integer, nullable=False, unique=False) text = db.Column(db.Text, unique=False, nullable=False) date = db.Column(db.DateTime, nullable=False, default=lambda: datetime.now()) read = db.Column(db.Boolean, nullable=False, default=False)
class Announcement(db.Model): id = db.Column(db.Integer, primary_key=True) school_id = db.Column(db.Integer, db.ForeignKey("school.id"), nullable=False) author_id = db.Column(db.Integer, nullable=False, unique=False) author_role = db.Column(db.String(11), nullable=False, unique=False) header = db.Column(db.String(80), nullable=False, unique=False) text = db.Column(db.Text, unique=False, nullable=False) for_users = db.Column(db.String(34), unique=False, nullable=False) date = db.Column(db.DateTime, nullable=False, default=lambda: datetime.now())
class Grade(db.Model): id = db.Column(db.Integer, primary_key=True) number = db.Column(db.Integer, unique=False, nullable=False) letter = db.Column(db.String(1), unique=False, nullable=False) school_id = db.Column(db.Integer, db.ForeignKey("school.id"), nullable=False)
class Request(db.Model): id = db.Column(db.Integer, primary_key=True) region = db.Column(db.String(50), unique=False, nullable=False) city = db.Column(db.String(50), unique=False, nullable=False) school = db.Column(db.String(80), unique=False, nullable=False) name = db.Column(db.String(30), unique=False, nullable=False) surname = db.Column(db.String(30), unique=False, nullable=False) patronymic = db.Column(db.String(30), unique=False, nullable=False) email = db.Column(db.String(50), unique=True, nullable=False) password_hash = db.Column(db.String(128), unique=True, nullable=False)
class User: id = db.Column(db.Integer, primary_key=True) name = db.Column(db.String(30), unique=False, nullable=False) surname = db.Column(db.String(30), unique=False, nullable=False) patronymic = db.Column(db.String(30), unique=False, nullable=False) email = db.Column(db.String(50), unique=True, nullable=False) login = db.Column(db.String(31), unique=True, nullable=False) password_hash = db.Column(db.String(128), unique=False, nullable=False) throwaway_password = db.Column(db.Boolean, default=True)
class Subject(db.Model): id = db.Column(db.Integer, primary_key=True) name = db.Column(db.String(25), unique=False, nullable=False) school_id = db.Column(db.Integer, db.ForeignKey("school.id"), nullable=False)
class School(db.Model): id = db.Column(db.Integer, primary_key=True) region = db.Column(db.String(50), unique=False, nullable=False) city = db.Column(db.String(50), unique=False, nullable=False) school = db.Column(db.String(80), unique=False, nullable=False)