-1

My project requires a field that needs to be in every table:

created_at, updated_at, created_by, updated_by

I have an issue with created_by and updated_by, where I need to cater to references of users from multiple tables, as well as SYSTEM update. Order details can be updated by customers, employees as well as 3PL. Order details (eg: pricing, status) can also be updated by SYSTEM itself through daily cron job.

The updated_by field should cater for customers, employees, 3PL and SYSTEM update. How can this be achieved?

Customers
==========
customer_id int

Employees
==========
employee_id int
employee_role int

Three_PL
==========
three_pl_id int

Orders
========
order_id
order_status
created_at
updated_at
created_by int
updated_by int
user4157124
  • 2,533
  • 12
  • 24
  • 39
stackdisplay
  • 1,777
  • 4
  • 26
  • 41
  • Does this answer your question? [How can you represent inheritance in a database?](https://stackoverflow.com/questions/3579079/how-can-you-represent-inheritance-in-a-database) – philipxy May 10 '22 at 01:44

0 Answers0