u/Loud_Wrangler1255

SQL: Should I still use CreatedAt & UpdatedAt on the main table if I also have Audit tables?

Say I have a table with users:

USERS

-----

ID

EMAIL

PASSWORD

CREATED_AT

UPDATED_AT

then I also create a table to track changes:

USERS_LOGS

----------

USER_ID

TIMESTAMP

ID

EMAIL

PASSWORD

CREATED_AT

UPDATED_AT

Does it make sense to have CreatedAt and UpdatedAt on the USERS entity if there is already a "TIMESTAMP" field in USERS_LOGS?

reddit.com
u/Loud_Wrangler1255 — 24 hours ago

Should I still use CreatedAt & UpdatedAt on the main table if I also have Audit tables?

Say I have a table with users:

USERS

-----

ID

EMAIL

PASSWORD

CREATED_AT

UPDATED_AT

then I also create a table to track changes:

USERS_LOGS

----------

USER_ID

TIMESTAMP

ID

EMAIL

PASSWORD

CREATED_AT

UPDATED_AT

Does it make sense to have CreatedAt and UpdatedAt on the USERS entity if there is already a "TIMESTAMP" field in USERS_LOGS?

reddit.com
u/Loud_Wrangler1255 — 24 hours ago

Should I still use CreatedAt & UpdatedAt on the main table if I also have Audit tables?

Say I have a table with users:

USERS

-----

ID

EMAIL

PASSWORD

CREATED_AT

UPDATED_AT

then I also create a table to track changes:

USERS_LOGS

----------

USER_ID

TIMESTAMP

ID

EMAIL

PASSWORD

CREATED_AT

UPDATED_AT

Does it make sense to have CreatedAt and UpdatedAt on the USERS entity if there is already a "TIMESTAMP" field in USERS_LOGS?

reddit.com
u/Loud_Wrangler1255 — 24 hours ago

SQL: Should I still use CreatedAt & UpdatedAt on the main table if I also have Audit tables?

Say I have a table with users:

USERS
-----
ID
EMAIL
PASSWORD
CREATED_AT
UPDATED_AT

then I also create a table to track changes:

USERS_LOGS
----------
USER_ID
TIMESTAMP
ID
EMAIL
PASSWORD
CREATED_AT
UPDATED_AT

Does it make sense to have CreatedAt and UpdatedAt on the USERS entity if there is already a "TIMESTAMP" field in USERS_LOGS?

reddit.com
u/Loud_Wrangler1255 — 24 hours ago
▲ 3 r/SQL+1 crossposts

Should I still use CreatedAt & UpdatedAt on the main table if I also have Audit tables?

Say I have a table with users:

USERS
-----
ID
EMAIL
PASSWORD
CREATED_AT
UPDATED_AT

then I also create a table to track changes:

USERS_LOGS
----------
USER_ID
TIMESTAMP
ID
EMAIL
PASSWORD
CREATED_AT
UPDATED_AT

Does it make sense to have CreatedAt and UpdatedAt on the USERS entity if there is already a "TIMESTAMP" field in USERS_LOGS?

reddit.com
u/Loud_Wrangler1255 — 24 hours ago