2023-11-14 11:56:41 +00:00
|
|
|
from sqlalchemy import Column, DateTime, ForeignKey, String, func
|
2022-09-17 18:12:14 +00:00
|
|
|
|
2023-10-26 21:07:35 +00:00
|
|
|
from base.orm import Base
|
|
|
|
|
2022-09-03 10:50:14 +00:00
|
|
|
|
2022-08-11 09:09:57 +00:00
|
|
|
class ShoutCollection(Base):
|
2022-09-03 10:50:14 +00:00
|
|
|
__tablename__ = "shout_collection"
|
|
|
|
|
2023-10-30 21:00:55 +00:00
|
|
|
id = None
|
2022-11-30 17:21:15 +00:00
|
|
|
shout = Column(ForeignKey("shout.id"), primary_key=True)
|
|
|
|
collection = Column(ForeignKey("collection.id"), primary_key=True)
|
2022-08-11 09:09:57 +00:00
|
|
|
|
|
|
|
|
2022-09-03 10:50:14 +00:00
|
|
|
class Collection(Base):
|
|
|
|
__tablename__ = "collection"
|
|
|
|
|
2022-11-10 05:40:32 +00:00
|
|
|
slug = Column(String, unique=True)
|
2022-09-03 10:50:14 +00:00
|
|
|
title = Column(String, nullable=False, comment="Title")
|
|
|
|
body = Column(String, nullable=True, comment="Body")
|
|
|
|
pic = Column(String, nullable=True, comment="Picture")
|
2023-11-14 11:56:41 +00:00
|
|
|
createdAt = Column(DateTime(timezone=True), server_default=func.now(), comment="Created At")
|
2022-09-03 10:50:14 +00:00
|
|
|
createdBy = Column(ForeignKey("user.id"), comment="Created By")
|
2023-11-14 11:56:41 +00:00
|
|
|
publishedAt = Column(DateTime(timezone=True), server_default=func.now(), comment="Published At")
|