diff --git a/migration/extract.py b/migration/extract.py index ba1aa23a..947ec4ec 100644 --- a/migration/extract.py +++ b/migration/extract.py @@ -347,7 +347,7 @@ def prepare_html_body(entry): def extract_html(entry): - body_orig = (entry.get("body") or "").replace('\(', '(').replace('/)', ')') + body_orig = (entry.get("body") or "").replace('\(', '(').replace('\)', ')') media = entry.get("media", []) kind = entry.get("type") or "" print("[extract] kind: " + kind) diff --git a/orm/shout.py b/orm/shout.py index 255e2e24..7828aa62 100644 --- a/orm/shout.py +++ b/orm/shout.py @@ -39,14 +39,6 @@ class ShoutAuthor(Base): caption = Column(String, nullable=True, default="") -class ShoutAllowed(Base): - __tablename__ = "shout_allowed" - - id = None # type: ignore - shout = Column(ForeignKey("shout.slug"), primary_key=True) - user = Column(ForeignKey("user.id"), primary_key=True) - - class Shout(Base): __tablename__ = "shout" @@ -62,14 +54,13 @@ class Shout(Base): authors = relationship(lambda: User, secondary=ShoutAuthor.__tablename__) topics = relationship(lambda: Topic, secondary=ShoutTopic.__tablename__) reactions = relationship(lambda: Reaction) - visibleFor = relationship(lambda: User, secondary=ShoutAllowed.__tablename__) + visibility = Column(String, nullable=True) # owner authors community public + versionOf = Column(ForeignKey("shout.slug"), nullable=True) + lang = Column(String, default='ru') + oid = Column(String, nullable=True) createdAt = Column(DateTime, nullable=False, default=datetime.now, comment="Created at") updatedAt = Column(DateTime, nullable=True, comment="Updated at") publishedAt = Column(DateTime, nullable=True) deletedAt = Column(DateTime, nullable=True) - versionOf = Column(ForeignKey("shout.slug"), nullable=True) - draft = Column(Boolean, default=False) - lang = Column(String, default='ru') - oid = Column(String, nullable=True) diff --git a/schema.graphql b/schema.graphql index 9a1b8f14..2dbe82d6 100644 --- a/schema.graphql +++ b/schema.graphql @@ -419,18 +419,17 @@ type Shout { slug: String! body: String! createdAt: DateTime! - authors: [Author] - lang: String - community: String - cover: String - layout: String - draft: Boolean - versionOf: Shout # translations and adaptations - visibleFor: [User] topics: [Topic] mainTopic: String title: String subtitle: String + authors: [Author] + lang: String + community: String + cover: String + layout: String # audio video literature image + versionOf: String # for translations and re-telling the same story + visibility: String # owner authors community public updatedAt: DateTime updatedBy: User deletedAt: DateTime