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