This commit is contained in:
12
orm/topic.py
12
orm/topic.py
@@ -1,19 +1,15 @@
|
||||
from datetime import datetime
|
||||
|
||||
from sqlalchemy import Boolean, Column, DateTime, ForeignKey, String
|
||||
|
||||
from services.db import Base
|
||||
from base.orm import Base
|
||||
|
||||
|
||||
class TopicFollower(Base):
|
||||
__tablename__ = "topic_followers"
|
||||
|
||||
id = None # type: ignore
|
||||
follower = Column(ForeignKey("user.id"), primary_key=True, index=True)
|
||||
follower = Column(ForeignKey("author.id"), primary_key=True, index=True)
|
||||
topic = Column(ForeignKey("topic.id"), primary_key=True, index=True)
|
||||
createdAt = Column(
|
||||
DateTime, nullable=False, default=datetime.now, comment="Created at"
|
||||
)
|
||||
createdAt = Column(DateTime, nullable=False, default=datetime.now)
|
||||
auto = Column(Boolean, nullable=False, default=False)
|
||||
|
||||
|
||||
@@ -24,5 +20,5 @@ class Topic(Base):
|
||||
title = Column(String, nullable=False, comment="Title")
|
||||
body = Column(String, nullable=True, comment="Body")
|
||||
pic = Column(String, nullable=True, comment="Picture")
|
||||
community = Column(ForeignKey("community.id"), default=1, comment="Community")
|
||||
community = Column(ForeignKey("community.id"), default=1)
|
||||
oid = Column(String, nullable=True, comment="Old ID")
|
||||
|
Reference in New Issue
Block a user