Yeah our website has so many problems because we customized our website excessively. So a few of records on table were created/removed while I don't aware of it.
I tried to add Time Stamp
column on some tables under this issue. But some fatal errors came out after adding Time Stamp
. Because I just create column without setting on either foreign key or primary key.
This is one of the error messages I faced.
An error occurred while saving this profile.SQLSTATE[23000]: Integrity constraint violation: 1452 Cannot add or update a child row: a foreign key constraint fails (
kbethos_wh
.jet_profile_products
, CONSTRAINTFK_JET_PROFILE_PRDS_PRD_ID_CAT_PRD_ENTT_ENTT_ID
FOREIGN KEY (product_id
) REFERENCEScatalog_product_entity
(entity_id
) ON DELETE CASCADE), query was: INSERT INTOjet_profile_products
(profile_id
,product_id
) VALUES (?, ?) File:/home/kbethos/public_html/wh/lib/Zend/Db/Statement/Pdo.php Line: 235
My question is without any problem, I want to add time stamp column because I would like to know when they are created by whom or some codes I haven't noticed.
I used this code to add time stamp column before
ALTER TABLE
catalog_eav_attribute
ADDlastUpdated
TIMESTAMP ON UPDATE CURRENT_TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP ;