โ Table 'tbl_notification_admin_views' already exists!
| Column | Type | Null | Key | Default | Extra |
|---|---|---|---|---|---|
| user_id | int(11) | NO | PRI | ||
| notification_id | int(11) | NO | PRI | ||
| viewed_at | timestamp | NO | current_timestamp() |
๐ Current records in table: 308
โ Test insert failed: SQLSTATE[23000]: Integrity constraint violation: 1452 Cannot add or update a child row: a foreign key constraint fails (`learwdxg_ville`.`tbl_notification_admin_views`, CONSTRAINT `fk_nav_notif` FOREIGN KEY (`notification_id`) REFERENCES `tbl_notifications` (`notification_id`) ON DELETE CASCADE)
โ Foreign key constraint working: SQLSTATE[23000]: Integrity constraint violation: 1452 Cannot add or update a child row: a foreign key constraint fails (`learwdxg_ville`.`tbl_notification_admin_views`, CONSTRAINT `fk_nav_user` FOREIGN KEY (`user_id`) REFERENCES `tbl_users` (`user_id`) ON DELETE CASCADE)
โ Foreign key constraint working: SQLSTATE[23000]: Integrity constraint violation: 1452 Cannot add or update a child row: a foreign key constraint fails (`learwdxg_ville`.`tbl_notification_admin_views`, CONSTRAINT `fk_nav_notif` FOREIGN KEY (`notification_id`) REFERENCES `tbl_notifications` (`notification_id`) ON DELETE CASCADE)
Now go back to your application and: