class ContestantModel(db.Model): id = db.Column(db.Integer, primary_key=True, nullable=False) name = db.Column(db.String(16), nullable=False) gender = db.Column(ENUM('male', 'female'), nullable=False) birth = db.Column(db.Date, nullable=False) agent_phone = db.Column(db.String(16), nullable=False) phone = db.Column(db.String(16), nullable=True) school = db.Column(db.String(64), nullable=True) grade = db.Column(db.Integer, nullable=True) klass = db.Column(db.Integer, nullable=True) zip_code = db.Column(db.String(8), nullable=False) address = db.Column(db.String(128), nullable=False) detail_address = db.Column(db.String(128), nullable=False) sector = db.Column(ENUM('programming', 'design', 'business'), nullable=False) photo = db.Column(db.String(64), nullable=True) password = db.Column(db.String(256), nullable=False) lunch_number = db.Column(db.Integer, nullable=False)
class CalenderModel(db.Model): id = db.Column(db.Integer, primary_key=True, nullable=False) context = db.Column(db.String(32), nullable=True) begin = db.Column(db.DateTime, nullable=False) end = db.Column(db.DateTime, nullable=False) status = db.Column(db.String(64), nullable=False) visable = db.Column(db.Boolean, nullable=False)
class QaModel(db.Model): id = db.Column(db.Integer, primary_key=True, nullable=False) name = db.Column(db.String(16), nullable=False) email = db.Column(db.String(32), nullable=False) question = db.Column(db.Text, nullable=False) answer = db.Column(db.Text, nullable=True) create_datetime = db.Column(db.DateTime, nullable=False) is_visable = db.Column(db.Boolean, nullable=False, default=True)
class AssignmentModel(db.Model): id = db.Column(db.Integer, primary_key=True, nullable=False) contestant_id = db.Column(db.Integer, db.ForeignKey('contestant_model.id'), nullable=False) file = db.Column(db.String(256), nullable=True) category = db.relationship('ContestantModel', backref=db.backref('assignment', lazy=True))
class AdminAccountModel(db.Model): id = db.Column(db.Integer, primary_key=True, nullable=False) username = db.Column(db.String(32), nullable=False) password = db.Column(db.String(256), nullable=False)