mirror of https://github.com/sipwise/db-schema.git
* "partition" is a reserved word in MariaDB and as such
the existing column with name partition is escaped
as `partition`
* MariaDB is more restrictive to column alterations that have
foreign keys in another tables and as such added
constract drop/add wrapped into LOCK TABLES.
LOCK TABLES is essential there as after DROP FOREIGN KEY
up until the CONSTRANT is recreated again there is a chance
to break the consistency with a wrong sql statement executed
when the up script is being applied.
Change-Id: I4b08a1c5b2c5e1632e2683f62251fe3873ebc58e
changes/88/8088/8
parent
d7d4b1eed2
commit
8e03d7b475
@ -1,3 +1,13 @@
|
||||
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;
|
||||
|
||||
Loading…
Reference in new issue