from sqlalchemy import Integer, Text, DateTime, func, Boolean, text

from models.database_models import Base, Column


class Comment(Base):
    __tablename__ = "comment"

    id = Column(Integer, primary_key=True, )
    user_id = Column(Integer, nullable=False, comment="评论用户的 ID")
    post_id = Column(Integer, nullable=False, comment="Post 文章的 ID")
    content = Column(Text, nullable=False, comment="用户的评论")

    create_time = Column(DateTime, server_default=func.now(), comment="创建时间")
    update_time = Column(DateTime, server_default=func.now(), onupdate=func.now(), comment="更新时间")
    deleted = Column(Boolean, default=False, server_default=text('0'), nullable=False, comment="该项目是否被删除")

[((9, 9, 9, 44), 'models.database_models.Column', 'Column', (), '', False, 'from models.database_models import Base, Column\n'), ((10, 14, 10, 75), 'models.database_models.Column', 'Column', (), '', False, 'from models.database_models import Base, Column\n'), ((11, 14, 11, 74), 'models.database_models.Column', 'Column', (), '', False, 'from models.database_models import Base, Column\n'), ((12, 14, 12, 69), 'models.database_models.Column', 'Column', (), '', False, 'from models.database_models import Base, Column\n'), ((14, 50, 14, 60), 'sqlalchemy.func.now', 'func.now', ({}, {}), '()', False, 'from sqlalchemy import Integer, Text, DateTime, func, Boolean, text\n'), ((15, 50, 15, 60), 'sqlalchemy.func.now', 'func.now', ({}, {}), '()', False, 'from sqlalchemy import Integer, Text, DateTime, func, Boolean, text\n'), ((15, 71, 15, 81), 'sqlalchemy.func.now', 'func.now', ({}, {}), '()', False, 'from sqlalchemy import Integer, Text, DateTime, func, Boolean, text\n'), ((16, 60, 16, 69), 'sqlalchemy.text', 'text', ({(16, 65, 16, 68): '"""0"""'}, {}), "('0')", False, 'from sqlalchemy import Integer, Text, DateTime, func, Boolean, text\n')]