from sqlalchemy import Column, DateTime, Integer, String
from sqlalchemy.schema import FetchedValue
from application import db


class Admin(db.Model):
    __tablename__ = 'admin'

    id = db.Column(Integer, primary_key=True)
    username = db.Column(String(100), nullable=False, server_default=FetchedValue())
    password = db.Column(String(128), nullable=False, server_default=FetchedValue())
    power = db.Column(String(128), nullable=False, server_default=FetchedValue())
    chinese_name = db.Column(String(128), nullable=False, server_default=FetchedValue())
    d_id = db.Column(Integer, nullable=False, server_default=FetchedValue())
    last_time = db.Column(Integer, nullable=False, server_default=FetchedValue())
    p_id = db.Column(Integer, nullable=False, server_default=FetchedValue())
    role_id = db.Column(Integer, nullable=False, server_default=FetchedValue())
    c_id = db.Column(String(32), nullable=False, server_default=FetchedValue())
