You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
db-schema/db_scripts/diff/15690.up

10 lines
442 B

use kamailio;
SET autocommit=0;
DELETE FROM `sems_registrations` WHERE `sems_registrations`.`subscriber_id` NOT IN (SELECT `id` FROM `subscriber`);
COMMIT;
ALTER TABLE `sems_registrations`
ADD CONSTRAINT `sub_id_ref` FOREIGN KEY (`subscriber_id`) REFERENCES `subscriber` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
ADD CONSTRAINT `lcr_gw_ref` FOREIGN KEY (`peer_host_id`) REFERENCES `lcr_gw` (`id`) ON DELETE CASCADE ON UPDATE CASCADE;