refs #6372 DeleteTablesFromVn2008 #2055
|
@ -1,6 +1,6 @@
|
|||
DELIMITER $$
|
||||
CREATE OR REPLACE DEFINER=`root`@`localhost` TRIGGER `vn`.`movementLabel_afterUpdate`
|
||||
AFTER UPDATE ON `vn`.`movementLabel`
|
||||
CREATE OR REPLACE DEFINER=`root`@`localhost` TRIGGER `vn`.`saleLabel_afterUpdate`
|
||||
AFTER UPDATE ON `vn`.`saleLabel`
|
||||
FOR EACH ROW
|
||||
IF NEW.stem >= (SELECT s.quantity FROM sale s WHERE s.id = NEW.saleFk) THEN
|
||||
UPDATE sale s SET s.isPicked = TRUE WHERE s.id = NEW.saleFk;
|
|
@ -1,10 +0,0 @@
|
|||
CREATE OR REPLACE DEFINER=`root`@`localhost`
|
||||
SQL SECURITY DEFINER
|
||||
VIEW `vn2008`.`movement_label`
|
||||
AS SELECT
|
||||
`m`.`saleFk` AS `Id_movimiento`,
|
||||
`m`.`label`,
|
||||
`m`.`stem`,
|
||||
`m`.`created`
|
||||
FROM
|
||||
`vn`.`movementLabel` `m`;
|
|
@ -1,6 +1,8 @@
|
|||
DROP TRIGGER IF EXISTS `vn2008`.`movement_label_afterUpdate`;
|
||||
|
||||
ALTER TABLE IF EXISTS `vn2008`.`movement_label` RENAME `vn`.`movementLabel`;
|
||||
DROP VIEW IF EXISTS `vn`.`saleLabel`;
|
||||
|
||||
ALTER TABLE IF EXISTS `vn`.`movementLabel`
|
||||
ALTER TABLE IF EXISTS `vn2008`.`movement_label` RENAME `vn`.`saleLabel`;
|
||||
|
||||
ALTER TABLE IF EXISTS `vn`.`saleLabel`
|
||||
CHANGE COLUMN IF EXISTS `Id_movimiento` `saleFk` int(11) NOT NULL;
|
||||
|
|
|
@ -3,3 +3,5 @@ ALTER TABLE IF EXISTS `vn2008`.`warehouse_pickup` RENAME `vn`.`warehousePickup`;
|
|||
ALTER TABLE IF EXISTS `vn`.`warehousePickup`
|
||||
CHANGE COLUMN IF EXISTS `warehouse_id` `warehouseFk` smallint(5) unsigned NOT NULL,
|
||||
CHANGE COLUMN IF EXISTS `agency_id` `agencyModeFk` int(11) DEFAULT NULL;
|
||||
|
||||
ALTER TABLE `vn`.`warehousePickup` COMMENT='Agencia de recogida para cada almacén';
|
||||
|
|
Loading…
Reference in New Issue