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/15288_not_replicated.up

14 lines
480 B

SET sql_log_bin=0;
USE billing;
#undo 15251:
ALTER TABLE lnp_numbers DROP FOREIGN KEY l_n_lnpproid_ref;
DROP INDEX l_n_lnpproidnumber_idx ON lnp_numbers;
ALTER TABLE lnp_numbers ADD CONSTRAINT l_n_lnpproid_ref FOREIGN KEY (lnp_provider_id) REFERENCES lnp_providers (id) ON DELETE RESTRICT ON UPDATE CASCADE;
UPDATE lnp_numbers
SET number=SUBSTRING_INDEX(SUBSTRING_INDEX(number,'--',2),'--',-1)
WHERE number LIKE 'dupe--%--%';
CREATE INDEX l_n_start_idx ON lnp_numbers (start);