// Fix on shops + remove id_group_shop from stock + fix stock

git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@8015 b9a71923-0436-4b27-9f14-aed3839534dd
This commit is contained in:
rMalie
2011-08-11 09:38:24 +00:00
parent eec48ed7b5
commit e093ecd554
16 changed files with 110 additions and 109 deletions
+3 -3
View File
@@ -1767,14 +1767,14 @@ CREATE TABLE `PREFIX_stock` (
`id_stock` INT( 11 ) UNSIGNED NOT NULL AUTO_INCREMENT,
`id_product` INT( 11 ) UNSIGNED NOT NULL,
`id_product_attribute` INT( 11 ) UNSIGNED NOT NULL,
`id_group_shop` INT( 11 ) UNSIGNED NOT NULL,
`id_shop` INT(11) UNSIGNED NOT NULL,
`quantity` INT(11) NOT NULL,
PRIMARY KEY (`id_stock`),
KEY `id_product` (`id_product`),
KEY `id_product_attribute` (`id_product_attribute`),
KEY `id_product_attribute` (`id_product_attribute`),
KEY `id_group_shop` (`id_group_shop`),
KEY `id_shop` (`id_shop`)
KEY `id_shop` (`id_shop`),
UNIQUE KEY `product_stock` (`id_product` ,`id_product_attribute` ,`id_shop`)
) ENGINE=ENGINE_TYPE DEFAULT CHARSET=utf8;
CREATE TABLE `PREFIX_country_shop` (
+31 -31
View File
@@ -1127,34 +1127,34 @@ INSERT INTO `PREFIX_store` (`id_store`, `id_country`, `id_state`, `name`, `addre
INSERT INTO `PREFIX_store_shop` (`id_store`, `id_shop`) (SELECT `id_store`, 1 FROM `PREFIX_store`);
INSERT INTO `PREFIX_stock` (`id_stock`, `id_product`, `id_product_attribute`, `id_group_shop`, `id_shop`, `quantity`) VALUES
(1, 1, 25, 1, 1, 150),
(2, 1, 26, 1, 1, 120),
(3, 1, 27, 1, 1, 230),
(4, 1, 28, 1, 1, 150),
(5, 1, 29, 1, 1, 120),
(6, 1, 30, 1, 1, 230),
(7, 1, 31, 1, 1, 150),
(8, 1, 32, 1, 1, 120),
(9, 1, 33, 1, 1, 230),
(10, 1, 34, 1, 1, 150),
(11, 1, 35, 1, 1, 120),
(12, 1, 36, 1, 1, 230),
(13, 1, 39, 1, 1, 150),
(14, 1, 40, 1, 1, 120),
(15, 1, 41, 1, 1, 230),
(16, 1, 42, 1, 1, 150),
(17, 2, 7, 1, 1, 120),
(18, 2, 8, 1, 1, 230),
(19, 2, 9, 1, 1, 150),
(20, 2, 10, 1, 1, 120),
(21, 5, 12, 1, 1, 230),
(22, 5, 13, 1, 1, 150),
(23, 5, 14, 1, 1, 120),
(24, 5, 15, 1, 1, 230),
(25, 6, 0, 1, 1, 230),
(26, 7, 19, 1, 1, 150),
(27, 7, 22, 1, 1, 120),
(28, 7, 23, 1, 1, 230),
(29, 8, 0, 1, 1, 230),
(30, 9, 0, 1, 1, 150);
INSERT INTO `PREFIX_stock` (`id_stock`, `id_product`, `id_product_attribute`, `id_shop`, `quantity`) VALUES
(1, 1, 25, 1, 150),
(2, 1, 26, 1, 120),
(3, 1, 27, 1, 230),
(4, 1, 28, 1, 150),
(5, 1, 29, 1, 120),
(6, 1, 30, 1, 230),
(7, 1, 31, 1, 150),
(8, 1, 31, 1, 120),
(9, 1, 33, 1, 230),
(10, 1, 34, 1, 150),
(11, 1, 35, 1, 120),
(12, 1, 36, 1, 230),
(13, 1, 39, 1, 150),
(14, 1, 40, 1, 120),
(15, 1, 41, 1, 230),
(16, 1, 42, 1, 150),
(17, 2, 7, 1, 120),
(18, 2, 8, 1, 230),
(19, 2, 9, 1, 150),
(20, 2, 10, 1, 120),
(21, 5, 12, 1, 230),
(22, 5, 13, 1, 150),
(23, 5, 14, 1, 120),
(24, 5, 15, 1, 230),
(25, 6, 0, 1, 230),
(26, 7, 19, 1, 150),
(27, 7, 22, 1, 120),
(28, 7, 23, 1, 230),
(29, 8, 0, 1, 230),
(30, 9, 0, 1, 150);
+5 -5
View File
@@ -65,18 +65,18 @@ CREATE TABLE `PREFIX_stock` (
`id_stock` INT( 11 ) UNSIGNED NOT NULL AUTO_INCREMENT,
`id_product` INT( 11 ) UNSIGNED NOT NULL,
`id_product_attribute` INT( 11 ) UNSIGNED NOT NULL,
`id_group_shop` INT( 11 ) UNSIGNED NOT NULL,
`id_shop` INT(11) UNSIGNED NOT NULL,
`quantity` INT(11) NOT NULL,
PRIMARY KEY (`id_stock`),
KEY `id_product` (`id_product`),
KEY `id_product_attribute` (`id_product_attribute`),
KEY `id_product_attribute` (`id_product_attribute`),
KEY `id_group_shop` (`id_group_shop`),
KEY `id_shop` (`id_shop`)
KEY `id_shop` (`id_shop`),
UNIQUE KEY `product_stock` (`id_product` ,`id_product_attribute` ,`id_shop`)
) ENGINE=ENGINE_TYPE DEFAULT CHARSET=utf8;
INSERT INTO `PREFIX_stock` (id_product, id_group_shop, id_shop) (SELECT p.id_product, 1, 1 FROM PREFIX_product p LEFT JOIN PREFIX_product_attribute pa ON (p.id_product = pa.id_product) WHERE pa.id_product_attribute IS NULL);
INSERT INTO `PREFIX_stock` (id_product, id_product_attribute, id_group_shop, id_shop) (SELECT id_product, id_product_attribute, 1, 1 FROM PREFIX_product_attribute);
INSERT INTO `PREFIX_stock` (id_product, id_shop) (SELECT p.id_product, 1 FROM PREFIX_product p LEFT JOIN PREFIX_product_attribute pa ON (p.id_product = pa.id_product) WHERE pa.id_product_attribute IS NULL);
INSERT INTO `PREFIX_stock` (id_product, id_product_attribute, id_shop) (SELECT id_product, id_product_attribute, 1 FROM PREFIX_product_attribute);
CREATE TABLE `PREFIX_country_shop` (
`id_country` INT( 11 ) UNSIGNED NOT NULL,