string-enum-fix
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
from sqlalchemy import Column, ForeignKey, Enum
|
||||
from sqlalchemy import Column, ForeignKey, Enum, String
|
||||
from sqlalchemy.orm import relationship
|
||||
from services.db import Base
|
||||
from orm.author import Author
|
||||
@@ -18,7 +18,7 @@ class Invite(Base):
|
||||
inviter_id = Column(ForeignKey("author.id"), nullable=False, index=True)
|
||||
author_id = Column(ForeignKey("author.id"), nullable=False, index=True)
|
||||
shout_id = Column(ForeignKey("shout.id"), nullable=False, index=True)
|
||||
status = Column(Enum(InviteStatus), default=InviteStatus.PENDING.value)
|
||||
status = Column(String, default=InviteStatus.PENDING.value)
|
||||
|
||||
inviter = relationship(Author, foreign_keys=[inviter_id])
|
||||
author = relationship(Author, foreign_keys=[author_id])
|
||||
|
@@ -38,6 +38,6 @@ class Reaction(Base):
|
||||
quote = Column(String, nullable=True, comment="Original quoted text")
|
||||
shout = Column(ForeignKey("shout.id"), nullable=False, index=True)
|
||||
created_by = Column(ForeignKey("author.id"), nullable=False, index=True)
|
||||
kind = Column(Enum(ReactionKind), nullable=False, index=True)
|
||||
kind = Column(String, nullable=False, index=True)
|
||||
|
||||
oid = Column(String)
|
||||
|
@@ -80,7 +80,7 @@ class Shout(Base):
|
||||
communities = relationship(lambda: Community, secondary="shout_community")
|
||||
reactions = relationship(lambda: Reaction)
|
||||
|
||||
visibility = Column(Enum(ShoutVisibility), default=ShoutVisibility.AUTHORS.value)
|
||||
visibility = Column(String, default=ShoutVisibility.AUTHORS.value)
|
||||
|
||||
lang = Column(String, nullable=False, default="ru", comment="Language")
|
||||
version_of = Column(ForeignKey("shout.id"), nullable=True)
|
||||
|
Reference in New Issue
Block a user