some fixes for models

This commit is contained in:
2021-08-19 18:33:39 +03:00
parent 0cb0b85bce
commit 94518adcc5
10 changed files with 31 additions and 38 deletions

View File

@@ -9,11 +9,9 @@ from orm.base import Base
class Shout(Base):
__tablename__ = 'shout'
id = None
slug: str = Column(String, primary_key=True)
org_id: str = Column(ForeignKey("organization.id"), nullable=False)
author_id: str = Column(ForeignKey("user.id"), nullable=False, comment="Author")
org_id: int = Column(Integer, ForeignKey("organization.id"), nullable=False, comment="Organization")
author_id: int = Column(Integer, ForeignKey("user.id"), nullable = False, comment="Author")
body: str = Column(String, nullable=False, comment="Body")
createdAt: str = Column(DateTime, nullable=False, default = datetime.now, comment="Created at")
updatedAt: str = Column(DateTime, nullable=True, comment="Updated at")