Merge remote-tracking branch 'origin/product-procedures' into front-styles
This commit is contained in:
@@ -21,7 +21,7 @@ VALUES
|
||||
('reset-password', 'reset-password', '/views/ResetPasswordView.vue', '{"guest":true}', 1),
|
||||
('verify-email', 'verify-email', '/views/VerifyEmailView.vue', '{"guest":true}', 1);
|
||||
|
||||
-- INSERT INTO `b2b_routes` (`id`, `name`, `path`, `component`, `meta`, `active`) VALUES (1, 'root', '', '', '{"trans": "route.root"}', 0);
|
||||
-- INSERT INTO `b2b_routes` (`id`, `name`, `path`, `component`, `meta`, `active`) VALUES (1, 'root', '', '', '{"trans": "route.root"}', 0);
|
||||
-- INSERT INTO `b2b_routes` (`id`, `name`, `path`, `component`, `meta`, `active`) VALUES (2, 'home', '', '/views/HomeView.vue', '{"trans": "route.home"}', 1);
|
||||
-- INSERT INTO `b2b_routes` (`id`, `name`, `path`, `component`, `meta`, `active`) VALUES (3, 'login', 'login', '/views/LoginView.vue', '{"guest":true}', 1);
|
||||
-- INSERT INTO `b2b_routes` (`id`, `name`, `path`, `component`, `meta`, `active`) VALUES (4, 'register', 'register', '/views/RegisterView.vue', '{"guest":true}', 1);
|
||||
@@ -29,7 +29,7 @@ VALUES
|
||||
-- INSERT INTO `b2b_routes` (`id`, `name`, `path`, `component`, `meta`, `active`) VALUES (6, 'reset-password', 'reset-password', '/views/ResetPasswordForm.vue', '{"guest":true}', 1);
|
||||
-- INSERT INTO `b2b_routes` (`id`, `name`, `path`, `component`, `meta`, `active`) VALUES (7, 'verify-email', 'verify-email', '/views/VerifyEmailView.vue', '{"guest":true}', 1);
|
||||
-- INSERT INTO `b2b_routes` (`id`, `name`, `path`, `component`, `meta`, `active`) VALUES (8, 'category', 'category/:category_id-:link_rewrite', '/views/CategoryView.vue', '{"guest":true}', 1);
|
||||
-- INSERT INTO `b2b_routes` (`id`, `name`, `path`, `component`, `meta`, `active`) VALUES (9, 'customer-products-category', 'products/:category_id-:link_rewrite', '/components/admin/PageProducts.vue', '{
|
||||
-- INSERT INTO `b2b_routes` (`id`, `name`, `path`, `component`, `meta`, `active`) VALUES (9, 'admin-products-category', 'products/:category_id-:link_rewrite', '/components/admin/PageProducts.vue', '{
|
||||
-- "guest": true
|
||||
-- }', 1);
|
||||
-- INSERT INTO `b2b_routes` (`id`, `name`, `path`, `component`, `meta`, `active`) VALUES (10, 'customer-addresses', 'addresses', '/components/customer/PageAddresses.vue', '{"guest":true}', 1);
|
||||
@@ -37,7 +37,7 @@ VALUES
|
||||
-- INSERT INTO `b2b_routes` (`id`, `name`, `path`, `component`, `meta`, `active`) VALUES (12, 'customer-orders', 'orders', '/components/customer/PageOrders.vue', '{"guest":true}', 1);
|
||||
-- INSERT INTO `b2b_routes` (`id`, `name`, `path`, `component`, `meta`, `active`) VALUES (13, 'customer-statistic', 'statistic', '/components/customer/PageStatistic.vue', '{"guest":true}', 1);
|
||||
-- INSERT INTO `b2b_routes` (`id`, `name`, `path`, `component`, `meta`, `active`) VALUES (14, 'customer-product-details', 'products/:product_id', '/components/admin/ProductDetailView.vue', '{"guest":true}', 1);
|
||||
-- INSERT INTO `b2b_routes` (`id`, `name`, `path`, `component`, `meta`, `active`) VALUES (15, 'customer-products', 'products', '/components/admin/PageProducts.vue', '{"guest":true}', 1);
|
||||
-- INSERT INTO `b2b_routes` (`id`, `name`, `path`, `component`, `meta`, `active`) VALUES (15, 'admin-products', 'products', '/components/admin/PageProducts.vue', '{"guest":true}', 1);
|
||||
|
||||
|
||||
CREATE TABLE IF NOT EXISTS b2b_top_menu (
|
||||
@@ -63,7 +63,7 @@ INSERT IGNORE INTO `b2b_top_menu` (`menu_id`, `label`, `parent_id`, `params`, `a
|
||||
|
||||
-- INSERT INTO `b2b_top_menu` (`menu_id`, `label`, `parent_id`, `params`, `active`, `position`) VALUES (1, '{"name":"root","trans":{"pl":{"label":"Menu główne"},"en":{"label":"Main Menu"},"de":{"label":"Hauptmenü"}}}', NULL, '{}', 1, 1);
|
||||
-- INSERT INTO `b2b_top_menu` (`menu_id`, `label`, `parent_id`, `params`, `active`, `position`) VALUES (2, '{
|
||||
-- "name": "customer-products",
|
||||
-- "name": "admin-products",
|
||||
-- "trans": {
|
||||
-- "pl": {
|
||||
-- "label": "Products"
|
||||
@@ -76,7 +76,7 @@ INSERT IGNORE INTO `b2b_top_menu` (`menu_id`, `label`, `parent_id`, `params`, `a
|
||||
-- }
|
||||
-- },
|
||||
-- "icon" : "quill:list"
|
||||
-- }', 1, '{"route":{"name":"customer-products","params":{"locale":""}}}', 1, 1);
|
||||
-- }', 1, '{"route":{"name":"admin-products","params":{"locale":""}}}', 1, 1);
|
||||
-- INSERT INTO `b2b_top_menu` (`menu_id`, `label`, `parent_id`, `params`, `active`, `position`) VALUES (3, '{
|
||||
-- "name": "customer-carts",
|
||||
-- "trans": {
|
||||
@@ -144,6 +144,8 @@ INSERT IGNORE INTO `b2b_top_menu` (`menu_id`, `label`, `parent_id`, `params`, `a
|
||||
-- }
|
||||
-- }
|
||||
-- }', 1, 1);
|
||||
-- INSERT INTO `b2b_top_menu` (`menu_id`, `label`, `parent_id`, `params`, `active`, `position`) VALUES (9, '{"name":"carts","trans":{"pl":{"label":"Koszyki"},"en":{"label":"Carts"},"de":{"label":"Warenkörbe"}}}', 3, '{"route":{"name":"home","params":{"locale":""}}}', 1, 1);
|
||||
|
||||
|
||||
|
||||
-- +goose Down
|
||||
|
||||
@@ -45,12 +45,7 @@ CREATE TABLE IF NOT EXISTS b2b_translations (
|
||||
|
||||
CREATE TABLE `b2b_roles` (
|
||||
`id` BIGINT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY,
|
||||
`name` VARCHAR(63) NULL,
|
||||
PRIMARY KEY (`id`)
|
||||
);
|
||||
CREATE UNIQUE INDEX `IX_b2b_roles_id`
|
||||
ON `b2b_roles` (
|
||||
`id` ASC
|
||||
`name` VARCHAR(63) NULL
|
||||
);
|
||||
|
||||
CREATE TABLE b2b_permissions (
|
||||
@@ -76,8 +71,20 @@ CREATE TABLE b2b_role_permissions (
|
||||
);
|
||||
|
||||
CREATE TABLE `b2b_top_menu_roles` (
|
||||
`top_menu_id` BIGINT UNSIGNED NOT NULL,
|
||||
`role_id` BIGINT UNSIGNED NOT NULL
|
||||
`top_menu_id` INT NOT NULL,
|
||||
`role_id` BIGINT UNSIGNED NOT NULL,
|
||||
|
||||
PRIMARY KEY (`top_menu_id`, `role_id`),
|
||||
|
||||
CONSTRAINT fk_top_menu_roles_menu
|
||||
FOREIGN KEY (`top_menu_id`)
|
||||
REFERENCES `b2b_top_menu`(`menu_id`)
|
||||
ON DELETE CASCADE,
|
||||
|
||||
CONSTRAINT fk_top_menu_roles_role
|
||||
FOREIGN KEY (`role_id`)
|
||||
REFERENCES `b2b_roles`(`id`)
|
||||
ON DELETE CASCADE
|
||||
);
|
||||
|
||||
-- customers
|
||||
@@ -216,15 +223,11 @@ CREATE TABLE b2b_specific_price (
|
||||
is_active BOOLEAN DEFAULT TRUE
|
||||
) ENGINE = InnoDB;
|
||||
CREATE INDEX idx_b2b_scope ON b2b_specific_price(scope);
|
||||
CREATE INDEX idx_b2b_customer ON b2b_specific_price(b2b_id_customer);
|
||||
CREATE INDEX idx_b2b_country ON b2b_specific_price(b2b_id_country);
|
||||
CREATE INDEX idx_b2b_active_dates ON b2b_specific_price(is_active, valid_from, valid_till);
|
||||
CREATE INDEX idx_b2b_lookup
|
||||
ON b2b_specific_price (
|
||||
scope,
|
||||
is_active,
|
||||
b2b_id_customer,
|
||||
b2b_id_country,
|
||||
from_quantity
|
||||
);
|
||||
|
||||
@@ -373,60 +376,6 @@ END$$
|
||||
|
||||
DELIMITER ;
|
||||
|
||||
CREATE TABLE b2b_specific_price_product (
|
||||
b2b_specific_price_id BIGINT UNSIGNED,
|
||||
id_product INT UNSIGNED,
|
||||
PRIMARY KEY (b2b_specific_price_id, id_product),
|
||||
FOREIGN KEY (b2b_specific_price_id) REFERENCES b2b_specific_price(id) ON DELETE CASCADE,
|
||||
FOREIGN KEY (id_product) REFERENCES ps_product(id_product) ON DELETE CASCADE
|
||||
);
|
||||
|
||||
CREATE TABLE b2b_specific_price_category (
|
||||
b2b_specific_price_id BIGINT UNSIGNED,
|
||||
id_category INT UNSIGNED,
|
||||
PRIMARY KEY (b2b_specific_price_id, id_category),
|
||||
FOREIGN KEY (b2b_specific_price_id) REFERENCES b2b_specific_price(id) ON DELETE CASCADE,
|
||||
FOREIGN KEY (id_category) REFERENCES ps_category(id_category) ON DELETE CASCADE
|
||||
);
|
||||
|
||||
CREATE TABLE b2b_specific_price_product_attribute (
|
||||
b2b_specific_price_id BIGINT UNSIGNED,
|
||||
id_product_attribute INT UNSIGNED,
|
||||
PRIMARY KEY (b2b_specific_price_id, id_product_attribute),
|
||||
FOREIGN KEY (b2b_specific_price_id) REFERENCES b2b_specific_price(id) ON DELETE CASCADE,
|
||||
FOREIGN KEY (id_product_attribute) REFERENCES ps_product_attribute(id_product_attribute) ON DELETE CASCADE
|
||||
);
|
||||
|
||||
CREATE TABLE b2b_specific_price_customer (
|
||||
b2b_specific_price_id BIGINT UNSIGNED,
|
||||
b2b_id_customer BIGINT UNSIGNED,
|
||||
PRIMARY KEY (b2b_specific_price_id, b2b_id_customer),
|
||||
FOREIGN KEY (b2b_specific_price_id) REFERENCES b2b_specific_price(id) ON DELETE CASCADE,
|
||||
FOREIGN KEY (b2b_id_customer) REFERENCES b2b_customers(id) ON DELETE CASCADE
|
||||
);
|
||||
|
||||
CREATE TABLE b2b_specific_price_country (
|
||||
b2b_specific_price_id BIGINT UNSIGNED,
|
||||
b2b_id_country BIGINT UNSIGNED,
|
||||
PRIMARY KEY (b2b_specific_price_id, b2b_id_country),
|
||||
FOREIGN KEY (b2b_specific_price_id) REFERENCES b2b_specific_price(id) ON DELETE CASCADE,
|
||||
FOREIGN KEY (b2b_id_country) REFERENCES b2b_countries(id) ON DELETE CASCADE
|
||||
);
|
||||
|
||||
CREATE INDEX idx_b2b_product_rel
|
||||
ON b2b_specific_price_product (id_product);
|
||||
|
||||
CREATE INDEX idx_b2b_category_rel
|
||||
ON b2b_specific_price_category (id_category);
|
||||
|
||||
CREATE INDEX idx_b2b_product_attribute_rel
|
||||
ON b2b_specific_price_product_attribute (id_product_attribute);
|
||||
|
||||
CREATE INDEX idx_bsp_customer
|
||||
ON b2b_specific_price_customer (b2b_specific_price_id, b2b_id_customer);
|
||||
|
||||
CREATE INDEX idx_bsp_country
|
||||
ON b2b_specific_price_country (b2b_specific_price_id, b2b_id_country);
|
||||
-- +goose Down
|
||||
|
||||
DROP TABLE IF EXISTS b2b_countries;
|
||||
|
||||
Reference in New Issue
Block a user