core/orm/collection.py
Untone e151034bab
Some checks failed
deploy / deploy (push) Failing after 1m43s
fix-imports
2023-10-23 17:51:13 +03:00

24 lines
855 B
Python

from datetime import datetime
from sqlalchemy import Column, DateTime, ForeignKey, String
from services.db import Base
class ShoutCollection(Base):
__tablename__ = "shout_collection"
id = None # type: ignore
shout = Column(ForeignKey("shout.id"), primary_key=True)
collection = Column(ForeignKey("collection.id"), primary_key=True)
class Collection(Base):
__tablename__ = "collection"
slug = Column(String, unique=True)
title = Column(String, nullable=False, comment="Title")
body = Column(String, nullable=True, comment="Body")
pic = Column(String, nullable=True, comment="Picture")
createdAt = Column(DateTime, default=datetime.now, comment="Created At")
createdBy = Column(ForeignKey("author.id"), comment="Created By")
publishedAt = Column(DateTime, default=datetime.now, comment="Published At")