0

I am desiging an app that have users who can write different posts(text, file image etc.). In order these posts to be made visible to the other users, there should be an admin who will validate that the content of the post is correct and will give permission for the publishing of the post. I am using relational database. What is the best way to design the database in order to support this feature?

Ivica Obadic
  • 75
  • 1
  • 10

2 Answers2

1
  1. You should create posts table having status_flag(value 0 and 1) column.

  2. If some one posts it, keep status 0 by default. When Admin approves it, change status to 1.

So single table will suffice all your need, you don't need to create dependency on tables resulting into better performance.

Mohsen Heydari
  • 7,256
  • 4
  • 31
  • 46
Bavishi PN
  • 379
  • 2
  • 6
0

Like Mohsen said, having a status_flag column would work. I would also add a foreign key in the posts table, that references the Id of the moderator. That way, you can track who approved each post. Additionally, you may want a third column, a timestamp called date_approved for more tracking purposes.

Michael
  • 425
  • 2
  • 9