from sqlalchemy import Column, String, TIMESTAMP, func, BIGINT, LargeBinary, ARRAY from sqlalchemy.ext.declarative import declarative_base Base = declarative_base() class SQLarticle(Base): __tablename__ = 'posts' id = Column(BIGINT, primary_key=True) created_at = Column(TIMESTAMP(timezone=True), server_default=func.now()) hash = Column(String) content = Column(String) igid = Column(String) mark = Column(String) ip = Column(String) reference = Column(BIGINT) def __repr__(self): return f"" class SQLlog(Base): __tablename__ = 'logs' id = Column(BIGINT, primary_key=True) created_at = Column(TIMESTAMP(timezone=True), server_default=func.now()) message = Column(String) source = Column(String) def __repr__(self): return f"" class SQLfile(Base): __tablename__ = 'files' id = Column(BIGINT, primary_key=True) created_at = Column(TIMESTAMP(timezone=True), server_default=func.now()) type = Column(String) reference = Column(String) binary = Column(LargeBinary) def __repr__(self): return f"" class SQLuser(Base): __tablename__ = 'users' id = Column(BIGINT, primary_key=True) user = Column(String) password = Column(String) # hash , sha512 permission = Column(ARRAY(String)) def __repr__(self): return f""