Say I have a database with 3 tables: Stream
, Tag
and Post
What would be the appropriate way to achieve this? Obviously I'll need some kind of soft-delete flag on posts. I currently have 2 ideas in mind:
stream_id
, post_id
and is_deleted
deleted
column to Stream
that holds a JSON array of deleted posts' ids. The problem with this approach is querying based on is_deleted state.Are there any better ways?
Note: Currently, I need Tag
to stay in it's own table, rather than storing it as text in a column in Stream
You should have a new table with the columns post_id, is_deleted & user_id. In this way you can manage it easily or else it will be hectic work as per your options are considered. The table name will be like cross reference table ex: user_deleted_posts_xref