From 0de4404cb1c4630be6015ee3783d385352afaa85 Mon Sep 17 00:00:00 2001 From: Untone Date: Mon, 14 Apr 2025 16:02:19 +0300 Subject: [PATCH] draft-community --- CHANGELOG.md | 1 + orm/draft.py | 3 ++- schema/type.graphql | 3 +-- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 2c12cf79..facadd43 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,4 +1,5 @@ #### [0.4.18] - 2025-04-10 +- Fixed `Topic.stat.authors` and `Topic.stat.comments` - Fixed unique constraint violation for empty slug values: - Modified `update_draft` resolver to handle empty slug values - Modified `create_draft` resolver to prevent empty slug values diff --git a/orm/draft.py b/orm/draft.py index c29794c5..3783ce3a 100644 --- a/orm/draft.py +++ b/orm/draft.py @@ -31,7 +31,8 @@ class Draft(Base): # required created_at: int = Column(Integer, nullable=False, default=lambda: int(time.time())) created_by: int = Column(ForeignKey("author.id"), nullable=False) - + community: int = Column(ForeignKey("community.id"), nullable=False, default=1) + # optional layout: str = Column(String, nullable=True, default="article") slug: str = Column(String, unique=True) diff --git a/schema/type.graphql b/schema/type.graphql index 21243b81..6ed9b619 100644 --- a/schema/type.graphql +++ b/schema/type.graphql @@ -111,13 +111,12 @@ type Draft { id: Int! created_at: Int! created_by: Author! - + community: Community! layout: String slug: String title: String subtitle: String lead: String - description: String body: String media: [MediaItem] cover: String