ADR 0001: Post Publication Status Implementation
Status
Accepted
Context
The application needed a way to distinguish between published and unpublished posts. This was particularly important for:
- Managing post visibility
- Supporting draft functionality
- Ensuring only published posts are displayed in the main feed
- Maintaining data integrity and consistency
Decision
We decided to implement a boolean is_published field on posts with the following characteristics:
- Required field when creating new posts
- Default value of
falsefor new posts - Only published posts are returned by the API endpoints
- Backfilled existing posts to have
is_published = true
Consequences
Positive
- Clear separation between published and unpublished content
- Improved data consistency
- Better control over post visibility
- Simplified frontend logic by moving publication status handling to the backend
- Foundation for future editing workflow improvements
Negative
- Required a database migration to add the new field
- Needed to backfill existing data
- Additional complexity in post creation and editing flows
Implementation Notes
- Added
is_publishedfield to the Post model - Modified API endpoints to filter by publication status
- Removed frontend publication status handling
- Backfilled existing posts to maintain compatibility
- Enhanced error handling for publication status validation