USE billing;

LOCK TABLES ncos_lnp_list WRITE, lnp_numbers WRITE, lnp_providers WRITE;

ALTER TABLE ncos_lnp_list DROP FOREIGN KEY `c_l_l_lnpproid_ref`;
ALTER TABLE lnp_numbers DROP FOREIGN KEY `l_n_lnpproid_ref`;

ALTER TABLE lnp_providers MODIFY id int(11) unsigned not null auto_increment;

ALTER TABLE ncos_lnp_list ADD CONSTRAINT `c_l_l_lnpproid_ref` FOREIGN KEY (`lnp_provider_id`) REFERENCES `lnp_providers` (`id`) ON DELETE CASCADE ON UPDATE CASCADE;
ALTER TABLE lnp_numbers ADD CONSTRAINT `l_n_lnpproid_ref` FOREIGN KEY (`lnp_provider_id`) REFERENCES `lnp_providers` (`id`) ON UPDATE CASCADE;

UNLOCK TABLES;
