CakeProducts/tests/schema2.sql

94 lines
5.1 KiB
MySQL
Raw Normal View History

/*!999999\- enable the sandbox mode */
-- MariaDB dump 10.19 Distrib 10.6.18-MariaDB, for debian-linux-gnu (x86_64)
--
-- Host: localhost Database: open_erp
-- ------------------------------------------------------
-- Server version 10.6.18-MariaDB-0ubuntu0.22.04.1
DROP TABLE IF EXISTS `product_catalogs`;
CREATE TABLE `product_catalogs` (
`id` char(36) NOT NULL,
`name` varchar(255) NOT NULL,
`catalog_description` varchar(255) DEFAULT NULL,
`enabled` tinyint(1) NOT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `BY_NAME` (`name`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_general_ci;
INSERT INTO `product_catalogs` VALUES ('115153f3-2f59-4234-8ff8-e1b205761428','Automotive','',1),('f56f3412-ed23-490b-be6e-016208c415d2','Software','',1);
DROP TABLE IF EXISTS `product_categories`;
CREATE TABLE `product_categories` (
`id` int(11) unsigned NOT NULL AUTO_INCREMENT,
`product_catalog_id` char(36) NOT NULL,
`internal_id` char(36) NOT NULL,
`name` varchar(255) NOT NULL,
`category_description` text DEFAULT NULL,
`parent_id` int(11) DEFAULT NULL,
`lft` int(11) NOT NULL,
`rght` int(11) NOT NULL,
`enabled` tinyint(1) NOT NULL DEFAULT 0,
PRIMARY KEY (`id`),
UNIQUE KEY `BY_NAME_AND_CATALOG_ID` (`product_catalog_id`,`name`)
-- KEY `parent_id` (`parent_id`),
-- KEY `lft` (`lft`),
-- KEY `product_catalog_id` (`product_catalog_id`)
) ENGINE=InnoDB AUTO_INCREMENT=8 DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_general_ci;
INSERT INTO `product_categories` VALUES (1,'115153f3-2f59-4234-8ff8-e1b205761428','db4b4273-eddc-46d4-93c8-45cf7c6e058e','Engine','',NULL,1,4,1),(2,'115153f3-2f59-4234-8ff8-e1b205761428','3c2377c5-b97c-4bc9-9660-8f77b4893d8b','Engine Internals','',1,2,3,1),(3,'115153f3-2f59-4234-8ff8-e1b205761428','fbee6709-396f-4bb4-b60b-e125b0bc4e83','Electrical','',NULL,5,8,1),(4,'115153f3-2f59-4234-8ff8-e1b205761428','6d223283-361b-4f9f-a7f1-c97aa0ca4c23','Wiring','',3,6,7,1),(5,'115153f3-2f59-4234-8ff8-e1b205761428','c447b6f4-0fb1-4d59-ba45-5613829a725a','Suspension','',NULL,9,12,1),(6,'115153f3-2f59-4234-8ff8-e1b205761428','1e749d3b-aee0-48a5-8d6c-8cf2b83e9b6e','Coilovers','',5,10,11,1),(7,'f56f3412-ed23-490b-be6e-016208c415d2','8c89a3ca-d56f-46bf-a738-7e85b3342b2a','Support','',NULL,1,2,1);
DROP TABLE IF EXISTS `product_category_attributes`;
CREATE TABLE `product_category_attributes` (
`id` char(36) NOT NULL,
`name` varchar(255) NOT NULL,
`product_category_id` char(36) DEFAULT NULL,
`attribute_type_id` int(11) NOT NULL,
`enabled` tinyint(1) NOT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `BY_NAME_AND_PRODUCT_CATEGORY_ID_UNIQUE` (`name`,`product_category_id`),
KEY `BY_PRODUCT_CATEGORY_ID` (`product_category_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_general_ci;
INSERT INTO `product_category_attributes` VALUES ('bffebec4-2533-45b9-8f4e-e9169f5143d4','AWG','4',1,1);
DROP TABLE IF EXISTS `product_category_attribute_options`;
CREATE TABLE `product_category_attribute_options` (
`id` char(36) NOT NULL,
`product_category_attribute_id` char(36) NOT NULL,
`attribute_value` varchar(255) NOT NULL,
`attribute_label` varchar(255) NOT NULL,
`enabled` tinyint(1) NOT NULL DEFAULT 1,
PRIMARY KEY (`id`),
KEY `BY_PRODUCT_CATEGORY_ATTRIBUTE_ID` (`product_category_attribute_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_general_ci;
LOCK TABLES `product_category_attribute_options` WRITE;
INSERT INTO `product_category_attribute_options` VALUES ('0a19dbc8-b09b-4843-8955-3c1a9c94de27','bffebec4-2533-45b9-8f4e-e9169f5143d4','8','8',1),('1d7705d0-e4a8-4b88-ad86-b021493a6191','bffebec4-2533-45b9-8f4e-e9169f5143d4','10','10',1),('49d79d68-62ac-4dae-8757-4b4e31f00f26','bffebec4-2533-45b9-8f4e-e9169f5143d4','12','12',1),('6fb40b3d-ec9f-4ad0-b21a-26de0769e10c','bffebec4-2533-45b9-8f4e-e9169f5143d4','14','14',1),('871df26a-8d91-425c-8f94-ac450323674f','bffebec4-2533-45b9-8f4e-e9169f5143d4','4','4',1),('87a465f3-5c4c-4c1b-9dd2-d5c08831386d','bffebec4-2533-45b9-8f4e-e9169f5143d4','16','16',1),('9efa9fce-cdcd-43ae-a6cc-c8fb4076690e','bffebec4-2533-45b9-8f4e-e9169f5143d4','6','6',1),('bebc8041-4502-4a3e-a452-ee41a1c6890e','bffebec4-2533-45b9-8f4e-e9169f5143d4','20','20',1),('dd21c817-670b-4118-9dcb-e9e88ffc8c86','bffebec4-2533-45b9-8f4e-e9169f5143d4','18','18',1);
UNLOCK TABLES;
DROP TABLE IF EXISTS `products`;
CREATE TABLE `products` (
`id` char(36) NOT NULL,
`name` varchar(255) NOT NULL,
`product_category_id` char(36) NOT NULL,
`product_type_id` int(11) NOT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `BY_NAME_AND_CATEGORY_ID` (`product_category_id`,`name`),
KEY `product_category_id` (`product_category_id`),
KEY `product_type_id` (`product_type_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_general_ci;
DROP TABLE IF EXISTS `external_product_catalogs`;
CREATE TABLE `external_product_catalogs` (
`id` int(11) unsigned NOT NULL AUTO_INCREMENT,
`product_catalog_id` char(36) NOT NULL,
`base_url` varchar(255) NOT NULL,
`api_url` varchar(255) NOT NULL,
`created` datetime NOT NULL,
`deleted` datetime DEFAULT NULL,
`enabled` tinyint(1) NOT NULL,
PRIMARY KEY (`id`),
KEY `BY_PRODUCT_CATALOG_ID` (`product_catalog_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_general_ci;