Updating constraints
This is mysql-specific: Sometimes you need to update the foreign key constraint. First drop the key, then add it with the new constraint requirements, such as on update cascade:
ALTER TABLE zeprs.patient DROP FOREIGN KEY FKD0D3EB057D2B7913;
ALTER TABLE zeprs.patient ADD CONSTRAINT FKD0D3EB057D2B7913 FOREIGN KEY (`site_id`) REFERENCES `site` (`id`) ON UPDATE CASCADE;
You may add this type of sql statement into the App updates sql
console in the admin section to have this automatically run when the
app starts.
- Printer-friendly version
- Login to post comments
- PDF version