views:

42

answers:

1

I have a website that allows users with accounts. Account profiles are displayed on the front end of a website. Users can login and update their data, but it all must be approved by an admin (on a form) before the front end content reflects their update. The "live" data is stored across multiple tables in a Postgresql DB.

I'm looking for ideas for the (best / easiest) way to handle storing (db schema) this updated data that will allow an admin user to

  1. approve/deny updates independently for a user (approve update A, deny update B, and ignore update C)
  2. Be easy to maintain
  3. Be easy for me to pull the updates to show admin and then process each individual field request.

Admin will need to be able to see a list of all users that have pending updates and then be able to see which fields for a specific user was updated so they can approve/deny the request.

Users can freely update a field as many times as they want, but admin will always see the current field content and the last update the user made.

I don't need to be able to see exact differences (although brownie points if you know how). They really just need to be able to see the two fields

ie:

   Current          Update
+--------------+-------------+-------------+
|              |             | (o) Approve |
| description  | Description |             |
|              |             | (o) Deny    |
+--------------+-------------+-------------+
|              |             | (o) Approve |
| title        | Title       |             |
|              |             | (o) Deny    |
+--------------+-------------+-------------+
|                 [Submit]                 |
+------------------------------------------+

I'm open to any and all ideas, DB techniques, programming, or something else I haven't thought of.

Thanks in advance!

+1  A: 

It's just a status of a record, an extra column in your tables holding the current status will be enough.

Frank Heikens
how do you differentiate between data that able to be displayed on the front end (current data) and updates that are "pending" and not yet approved?
veilig
Admin: SELECT * FROM table WHERE current_status = 'pending';Public: SELECT * FROM table WHERE current_status = 'approved';
Frank Heikens