DROP USER IF EXISTS 'testuser_1'@'%';
CREATE USER 'testuser_1'@'%' IDENTIFIED BY 'testpassword1';
GRANT ALL PRIVILEGES ON `erp5_test_1`.* TO `testuser_1`@`%`;
GRANT PROCESS ON *.* TO `testuser_1`@`%`;
FLUSH PRIVILEGES;
DROP DATABASE IF EXISTS `erp5_test_1`;
CREATE DATABASE `erp5_test_1`;
CREATE TABLE `erp5_test_1`.`catalog` (
  `uid` bigint(20) unsigned NOT NULL,
  `security_uid` int(10) unsigned DEFAULT NULL,
  `owner` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL DEFAULT '',
  `viewable_owner` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL DEFAULT '',
  `path` varchar(255) NOT NULL DEFAULT '',
  `relative_url` varchar(255) NOT NULL DEFAULT '',
  `parent_uid` bigint(20) unsigned DEFAULT 0,
  `id` varchar(255) DEFAULT '',
  `description` text DEFAULT NULL,
  `title` varchar(255) DEFAULT '',
  `meta_type` varchar(255) DEFAULT '',
  `portal_type` varchar(255) DEFAULT '',
  `opportunity_state` varchar(255) DEFAULT '',
  `corporate_registration_code` varchar(255) DEFAULT NULL,
  `ean13_code` varchar(255) DEFAULT NULL,
  `validation_state` varchar(255) DEFAULT '',
  `simulation_state` varchar(255) DEFAULT '',
  `causality_state` varchar(255) DEFAULT '',
  `invoice_state` varchar(255) DEFAULT '',
  `payment_state` varchar(255) DEFAULT '',
  `event_state` varchar(255) DEFAULT '',
  `immobilisation_state` varchar(255) DEFAULT '',
  `reference` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT '',
  `grouping_reference` varchar(255) DEFAULT '',
  `grouping_date` datetime DEFAULT NULL,
  `source_reference` varchar(255) DEFAULT '',
  `destination_reference` varchar(255) DEFAULT '',
  `string_index` varchar(255) DEFAULT NULL,
  `int_index` int(11) DEFAULT NULL,
  `float_index` double DEFAULT NULL,
  `has_cell_content` tinyint(1) DEFAULT NULL,
  `creation_date` datetime DEFAULT NULL,
  `modification_date` datetime DEFAULT NULL,
  `indexation_timestamp` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(),
  PRIMARY KEY (`uid`),
  KEY `security_uid` (`security_uid`),
  KEY `owner` (`owner`),
  KEY `viewable_owner` (`viewable_owner`),
  KEY `Parent` (`parent_uid`),
  KEY `Path` (`path`),
  KEY `Title` (`title`),
  KEY `Reference` (`reference`),
  KEY `relative_url` (`relative_url`),
  KEY `Portal Type` (`portal_type`,`reference`),
  KEY `opportunity_state` (`opportunity_state`),
  KEY `validation_state_portal_type` (`validation_state`,`portal_type`),
  KEY `simulation_state_portal_type` (`simulation_state`,`portal_type`),
  KEY `causality_state_portal_type` (`causality_state`,`portal_type`),
  KEY `invoice_state` (`invoice_state`),
  KEY `payment_state` (`payment_state`),
  KEY `event_state` (`event_state`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;
