2024-11-13 03:23:11 +08:00
|
|
|
from sqlalchemy import Column, Integer, String, TIMESTAMP, func
|
|
|
|
from sqlalchemy.ext.declarative import declarative_base
|
|
|
|
|
|
|
|
Base = declarative_base()
|
|
|
|
|
|
|
|
class SQLarticle(Base):
|
|
|
|
__tablename__ = 'posts'
|
|
|
|
|
|
|
|
id = Column(Integer, primary_key=True)
|
|
|
|
created_at = Column(TIMESTAMP(timezone=True), server_default=func.now())
|
|
|
|
hash = Column(String)
|
|
|
|
ctx = Column(String)
|
|
|
|
igid = Column(String)
|
|
|
|
mark = Column(String)
|
|
|
|
|
|
|
|
def __repr__(self):
|
2024-11-12 21:12:23 +08:00
|
|
|
return f"<article(id={self.id}, hash={self.hash}, ctx={self.ctx}, igid={self.igid}, mark={self.mark}, created_at={self.created_at})>"
|