update fixtures / alter table vn2008.articles_nicho
This commit is contained in:
parent
f4735b4666
commit
3018898cad
|
@ -247,7 +247,6 @@ INSERT INTO `vn2008`.`empresa`(`id`, `abbreviation`, `registro`, `gerente_id`, `
|
|||
VALUES
|
||||
(442, 'WAY', 'Wayne Industries, Inc. operates as a warehouse for steel products.', '2', '1989-11-19', NULL, NULL, '1', '1', '00FF00', 'BruceWayne@verdnatura.es', NULL, '1989-08-11 12:31:22', '10', '1', NULL, '1', '1');
|
||||
|
||||
|
||||
INSERT INTO `vn`.`ticket`(`id`, `agencyModeFk`,`warehouseFk`,`routeFk`, `shipped`, `clientFk`,`nickname`, `addressFk`)
|
||||
VALUES
|
||||
(1, 1, 1, NULL, CURDATE(), 1, 'Batman', 101),
|
||||
|
@ -390,10 +389,10 @@ INSERT INTO `vn`.`itemBarcode`(`id`, `itemFk`, `code`)
|
|||
|
||||
INSERT INTO `vn`.`itemPlacement`(`itemFk`, `warehouseFk`, `code`)
|
||||
VALUES
|
||||
(1, 1, 'A1'),
|
||||
(1, 2, 'A2'),
|
||||
(1, 3, 'A3'),
|
||||
(2, 1, 'A4');
|
||||
( 1, 1, 'A1'),
|
||||
( 1, 2, 'A2'),
|
||||
( 1, 3, 'A3'),
|
||||
( 2, 1, 'A4');
|
||||
|
||||
INSERT INTO `edi`.`genus`(`genus_id`, `latin_genus_name`, `entry_date`, `expiry_date`, `change_date_time`)
|
||||
VALUES
|
||||
|
|
|
@ -0,0 +1,13 @@
|
|||
ALTER TABLE `vn2008`.`Articles_nicho`
|
||||
DROP FOREIGN KEY `Articles_nichos_fk`;
|
||||
ALTER TABLE `vn2008`.`Articles_nicho`
|
||||
CHANGE COLUMN `Id_Article` `Id_Article` INT(11) NOT NULL ,
|
||||
ADD COLUMN `id` INT NOT NULL AUTO_INCREMENT AFTER `modificationDate`,
|
||||
DROP PRIMARY KEY,
|
||||
ADD PRIMARY KEY (`id`);
|
||||
ALTER TABLE `vn2008`.`Articles_nicho`
|
||||
ADD CONSTRAINT `Articles_nichos_fk`
|
||||
FOREIGN KEY (`Id_Article`)
|
||||
REFERENCES `vn2008`.`Articles` (`Id_Article`)
|
||||
ON DELETE CASCADE
|
||||
ON UPDATE CASCADE;
|
|
@ -0,0 +1,12 @@
|
|||
CREATE
|
||||
OR REPLACE ALGORITHM = UNDEFINED
|
||||
DEFINER = `root`@`%`
|
||||
SQL SECURITY DEFINER
|
||||
VIEW `vn`.`itemPlacement` AS
|
||||
SELECT
|
||||
`an`.`id` AS `id`,
|
||||
`an`.`Id_Article` AS `itemFk`,
|
||||
`an`.`warehouse_id` AS `warehouseFk`,
|
||||
`an`.`nicho` AS `code`
|
||||
FROM
|
||||
`vn2008`.`Articles_nicho` `an`;
|
Loading…
Reference in New Issue