16 lines
899 B
Python
16 lines
899 B
Python
from sqlalchemy import Column, Integer, String, Boolean, DateTime
|
|
from sqlalchemy.sql import func
|
|
from ..core.database import Base
|
|
|
|
class Account(Base):
|
|
__tablename__ = "accounts"
|
|
|
|
id = Column(Integer, primary_key=True, index=True, autoincrement=True)
|
|
username = Column(String(500), unique=True, index=True, nullable=False, comment="用户名")
|
|
password = Column(String(1000), nullable=False, comment="密码")
|
|
status = Column(Integer, default=1, comment="状态: 1-正常, 0-禁用")
|
|
today_updated = Column(Integer, default=0, comment="是否更新")
|
|
project_name = Column(String(1000), comment="项目名称")
|
|
created_at = Column(DateTime, server_default=func.now(), comment="创建时间")
|
|
updated_at = Column(DateTime, server_default=func.now(), onupdate=func.now(), comment="更新时间")
|
|
update_time = Column(String(1000), comment="更新时间跨度") |