Assign values to created_at and updated_at in the database or at the UI?

johnkrytus

Registered User.
Local time
Today, 00:16
Joined
Mar 7, 2013
Messages
91
Is it better to assign values to created_at and updated_at in the database or at the UI?

On one hand I would say it should be done at in the database because it feels cleaner. Simply set default value of created_at to now() and its done. Updated_at is a trigger and it's done.

On the other hand, if it were buried in the vba of the UI, then I would not be recreating these things that I lost when I migrated from postgress to SQL.
 
If you're worried about destroying imported/converted values, save those and copy to a new table and update that table whenever you want.
 
I'm merely asking which is better practice? I have a friend who is an old school Access guy. He cannot understand why I would do anything on the backend. My other buddy is a Rails and database guy and has little use for anything important being on the front end.

Which is better? and why?
 

Users who are viewing this thread

Back
Top Bottom