Browse Source
If we really wanted to delete all items linked to a subscription when we delete a subscription we should change the database structure as such : ALTER TABLE serialitems ADD FOREIGN KEY ( itemnumber ) REFERENCES items (itemnumber) ON DELETE CASCADE ; ALTER TABLE serial CHANGE subscriptionid subscriptionid INT( 11 ) NOT NULL ALTER TABLE serial ADD INDEX subscription ( subscriptionid ) ALTER TABLE serial ADD FOREIGN KEY ( subscriptionid ) REFERENCES subscription (subscriptionid) ON DELETE CASCADE ;3.2.x
Henri-Damien LAURENT
15 years ago
2 changed files with 29 additions and 1 deletions
Loading…
Reference in new issue