#3530 Eliminar uso tabla person
gitea/salix/pipeline/head This commit is unstable Details

This commit is contained in:
Carlos Andrés 2022-07-29 16:04:18 +02:00
parent 918a09ad5c
commit 67feac7c6c
1 changed files with 25 additions and 29 deletions

View File

@ -18768,7 +18768,8 @@ DROP TABLE IF EXISTS `business`;
CREATE TABLE `business` ( CREATE TABLE `business` (
`business_id` int(11) NOT NULL AUTO_INCREMENT, `business_id` int(11) NOT NULL AUTO_INCREMENT,
`client_id` int(11) DEFAULT NULL, `client_id` int(11) DEFAULT NULL,
`provider_id` int(11) DEFAULT NULL, `provider_id__` int(11) DEFAULT NULL,
`companyCodeFk` char(3) CHARACTER SET utf8 COLLATE utf8_unicode_ci DEFAULT NULL,
`date_start` date DEFAULT NULL, `date_start` date DEFAULT NULL,
`date_end` date DEFAULT NULL, `date_end` date DEFAULT NULL,
`workerBusiness` longtext, `workerBusiness` longtext,
@ -18777,11 +18778,11 @@ CREATE TABLE `business` (
`occupationCodeFk` varchar(1) DEFAULT NULL, `occupationCodeFk` varchar(1) DEFAULT NULL,
PRIMARY KEY (`business_id`), PRIMARY KEY (`business_id`),
KEY `business_client` (`client_id`), KEY `business_client` (`client_id`),
KEY `bussiness_provider` (`provider_id`),
KEY `business_occupationCodeFk` (`occupationCodeFk`), KEY `business_occupationCodeFk` (`occupationCodeFk`),
KEY `business_companyCodeFk` (`companyCodeFk`),
CONSTRAINT `business_client` FOREIGN KEY (`client_id`) REFERENCES `profile` (`profile_id`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `business_client` FOREIGN KEY (`client_id`) REFERENCES `profile` (`profile_id`) ON DELETE CASCADE ON UPDATE CASCADE,
CONSTRAINT `business_occupationCodeFk` FOREIGN KEY (`occupationCodeFk`) REFERENCES `vn`.`occupationCode` (`code`) ON UPDATE CASCADE, CONSTRAINT `business_companyCodeFk` FOREIGN KEY (`companyCodeFk`) REFERENCES `vn`.`company` (`code`) ON UPDATE CASCADE,
CONSTRAINT `bussiness_provider` FOREIGN KEY (`provider_id`) REFERENCES `profile` (`profile_id`) ON DELETE CASCADE ON UPDATE CASCADE CONSTRAINT `business_occupationCodeFk` FOREIGN KEY (`occupationCodeFk`) REFERENCES `vn`.`occupationCode` (`code`) ON UPDATE CASCADE
) ENGINE=InnoDBDEFAULT CHARSET=utf8; ) ENGINE=InnoDBDEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */; /*!40101 SET character_set_client = @saved_cs_client */;
/*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_client = @@character_set_client */ ;
@ -19032,13 +19033,14 @@ CREATE TABLE `income_employee` (
`haber` decimal(10,2) NOT NULL DEFAULT '0.00', `haber` decimal(10,2) NOT NULL DEFAULT '0.00',
`id_incomeType` int(11) DEFAULT NULL, `id_incomeType` int(11) DEFAULT NULL,
`odbc_date` date DEFAULT NULL, `odbc_date` date DEFAULT NULL,
`person_id` int(11) DEFAULT NULL, `workerFk` int(11) unsigned NOT NULL,
`person_id__` int(11) DEFAULT NULL,
`concepto` longtext, `concepto` longtext,
PRIMARY KEY (`id`), PRIMARY KEY (`id`),
KEY `fperson_id` (`person_id`),
KEY `income_employeeId_incomeType_idx` (`id_incomeType`), KEY `income_employeeId_incomeType_idx` (`id_incomeType`),
KEY `income_employee_workerFk_idx` (`workerFk`),
CONSTRAINT `income_employeeId_incomeType` FOREIGN KEY (`id_incomeType`) REFERENCES `vn2008`.`payroll_conceptos` (`conceptoid`) ON UPDATE CASCADE, CONSTRAINT `income_employeeId_incomeType` FOREIGN KEY (`id_incomeType`) REFERENCES `vn2008`.`payroll_conceptos` (`conceptoid`) ON UPDATE CASCADE,
CONSTRAINT `income_employee_FK` FOREIGN KEY (`person_id`) REFERENCES `vn`.`person` (`id`) CONSTRAINT `income_employee_workerFk` FOREIGN KEY (`workerFk`) REFERENCES `vn`.`worker` (`id`) ON UPDATE CASCADE
) ENGINE=InnoDBDEFAULT CHARSET=utf8; ) ENGINE=InnoDBDEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */; /*!40101 SET character_set_client = @saved_cs_client */;
@ -19263,12 +19265,14 @@ DROP TABLE IF EXISTS `profile`;
/*!40101 SET character_set_client = utf8 */; /*!40101 SET character_set_client = utf8 */;
CREATE TABLE `profile` ( CREATE TABLE `profile` (
`profile_id` int(11) NOT NULL AUTO_INCREMENT, `profile_id` int(11) NOT NULL AUTO_INCREMENT,
`person_id` int(11) NOT NULL, `person_id__` int(11) DEFAULT NULL,
`profile_type_id` int(11) NOT NULL DEFAULT '1', `profile_type_id` int(11) NOT NULL DEFAULT '1',
`workerFk` int(10) unsigned DEFAULT NULL,
PRIMARY KEY (`profile_id`), PRIMARY KEY (`profile_id`),
KEY `profile_person_id_idx` (`person_id`), KEY `profile_person_id_idx` (`person_id__`),
KEY `profile_profile_type_id_idx` (`profile_type_id`), KEY `profile_profile_type_id_idx` (`profile_type_id`),
CONSTRAINT `profile_FK` FOREIGN KEY (`person_id`) REFERENCES `vn`.`person` (`id`) KEY `profile_workerFk_idx` (`workerFk`),
CONSTRAINT `profile_workerFk` FOREIGN KEY (`workerFk`) REFERENCES `vn`.`worker` (`id`) ON UPDATE CASCADE
) ENGINE=InnoDBDEFAULT CHARSET=utf8; ) ENGINE=InnoDBDEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */; /*!40101 SET character_set_client = @saved_cs_client */;
@ -29334,6 +29338,7 @@ CREATE TABLE `company` (
`phytosanitary` longtext COLLATE utf8_unicode_ci, `phytosanitary` longtext COLLATE utf8_unicode_ci,
`fhAdminNumber` int(11) DEFAULT NULL COMMENT 'número de cliente en FloraHolland', `fhAdminNumber` int(11) DEFAULT NULL COMMENT 'número de cliente en FloraHolland',
PRIMARY KEY (`id`), PRIMARY KEY (`id`),
UNIQUE KEY `companyCode_UNIQUE` (`code`),
KEY `gerente_id` (`workerManagerFk`), KEY `gerente_id` (`workerManagerFk`),
KEY `empresa_cliente_idx` (`clientFk`), KEY `empresa_cliente_idx` (`clientFk`),
KEY `Id_Proveedores_account` (`supplierAccountFk`), KEY `Id_Proveedores_account` (`supplierAccountFk`),
@ -36927,10 +36932,10 @@ CREATE TABLE `periodicityType` (
-- Table structure for table `person` -- Table structure for table `person`
-- --
DROP TABLE IF EXISTS `person`; DROP TABLE IF EXISTS `person__`;
/*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */; /*!40101 SET character_set_client = utf8 */;
CREATE TABLE `person` ( CREATE TABLE `person__` (
`id` int(11) NOT NULL AUTO_INCREMENT, `id` int(11) NOT NULL AUTO_INCREMENT,
`firstname` varchar(20) COLLATE utf8_unicode_ci DEFAULT NULL, `firstname` varchar(20) COLLATE utf8_unicode_ci DEFAULT NULL,
`surnames` varchar(60) COLLATE utf8_unicode_ci NOT NULL, `surnames` varchar(60) COLLATE utf8_unicode_ci NOT NULL,
@ -43363,22 +43368,10 @@ CREATE TABLE `worker` (
`code` varchar(3) COLLATE utf8_unicode_ci NOT NULL, `code` varchar(3) COLLATE utf8_unicode_ci NOT NULL,
`firstName` varchar(50) COLLATE utf8_unicode_ci DEFAULT NULL, `firstName` varchar(50) COLLATE utf8_unicode_ci DEFAULT NULL,
`lastName` varchar(50) COLLATE utf8_unicode_ci DEFAULT NULL, `lastName` varchar(50) COLLATE utf8_unicode_ci DEFAULT NULL,
`password__` varchar(50) CHARACTER SET utf8 DEFAULT NULL,
`email__` varchar(50) COLLATE utf8_unicode_ci DEFAULT NULL,
`extension__` varchar(10) COLLATE utf8_unicode_ci DEFAULT NULL,
`sub` int(11) unsigned DEFAULT NULL, `sub` int(11) unsigned DEFAULT NULL,
`user__` varchar(20) CHARACTER SET utf8 DEFAULT NULL,
`typeBussines__` varchar(30) CHARACTER SET utf8 DEFAULT 'no dejar vacio' COMMENT 'campo obsoleto, actualmente se rellena en laboral',
`laborCategory__` varchar(45) COLLATE utf8_unicode_ci DEFAULT NULL,
`started__` datetime DEFAULT NULL,
`ended__` datetime DEFAULT NULL,
`notes__` varchar(254) COLLATE utf8_unicode_ci DEFAULT NULL,
`photo` blob, `photo` blob,
`fi__` varchar(9) COLLATE utf8_unicode_ci DEFAULT NULL, `phone` varchar(9) COLLATE utf8_unicode_ci DEFAULT NULL,
`address__` varchar(50) COLLATE utf8_unicode_ci NOT NULL, `mobileExtension` int(4) DEFAULT NULL,
`birthed__` date NOT NULL,
`phone` varchar(9) COLLATE utf8_unicode_ci NOT NULL,
`clientFk__` int(11) DEFAULT NULL,
`userFk` int(10) unsigned DEFAULT NULL, `userFk` int(10) unsigned DEFAULT NULL,
`bossFk` int(11) NOT NULL DEFAULT '103', `bossFk` int(11) NOT NULL DEFAULT '103',
`fiDueDate` datetime DEFAULT NULL, `fiDueDate` datetime DEFAULT NULL,
@ -43392,17 +43385,20 @@ CREATE TABLE `worker` (
`originCountryFk` mediumint(8) unsigned DEFAULT NULL COMMENT 'País de origen', `originCountryFk` mediumint(8) unsigned DEFAULT NULL COMMENT 'País de origen',
`educationLevelFk` smallint(6) DEFAULT NULL, `educationLevelFk` smallint(6) DEFAULT NULL,
`SSN` varchar(15) COLLATE utf8_unicode_ci DEFAULT NULL, `SSN` varchar(15) COLLATE utf8_unicode_ci DEFAULT NULL,
`fi` varchar(15) COLLATE utf8_unicode_ci DEFAULT NULL,
`birth` date DEFAULT NULL,
`isDisable` tinyint(1) NOT NULL DEFAULT '0',
`isFreelance` tinyint(1) NOT NULL DEFAULT '0',
`isSsDiscounted` tinyint(1) NOT NULL DEFAULT '0',
`sex` enum('M','F') COLLATE utf8_unicode_ci NOT NULL DEFAULT 'F' COMMENT 'M Masculino F Femenino',
PRIMARY KEY (`id`), PRIMARY KEY (`id`),
UNIQUE KEY `CodigoTrabajador_UNIQUE` (`code`), UNIQUE KEY `CodigoTrabajador_UNIQUE` (`code`),
UNIQUE KEY `user` (`user__`),
UNIQUE KEY `user_id_UNIQUE` (`userFk`), UNIQUE KEY `user_id_UNIQUE` (`userFk`),
UNIQUE KEY `Id_Cliente_Interno` (`clientFk__`),
KEY `sub` (`sub`), KEY `sub` (`sub`),
KEY `boss_idx` (`bossFk`), KEY `boss_idx` (`bossFk`),
KEY `worker_FK` (`labelerFk`), KEY `worker_FK` (`labelerFk`),
KEY `worker_FK_2` (`educationLevelFk`), KEY `worker_FK_2` (`educationLevelFk`),
KEY `worker_FK_1` (`originCountryFk`), KEY `worker_FK_1` (`originCountryFk`),
CONSTRAINT `Clientes` FOREIGN KEY (`clientFk__`) REFERENCES `client` (`id`) ON UPDATE CASCADE,
CONSTRAINT `worker_FK` FOREIGN KEY (`labelerFk`) REFERENCES `printer` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `worker_FK` FOREIGN KEY (`labelerFk`) REFERENCES `printer` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
CONSTRAINT `worker_FK_1` FOREIGN KEY (`originCountryFk`) REFERENCES `country` (`id`) ON UPDATE CASCADE, CONSTRAINT `worker_FK_1` FOREIGN KEY (`originCountryFk`) REFERENCES `country` (`id`) ON UPDATE CASCADE,
CONSTRAINT `worker_FK_2` FOREIGN KEY (`educationLevelFk`) REFERENCES `educationLevel` (`id`) ON UPDATE CASCADE, CONSTRAINT `worker_FK_2` FOREIGN KEY (`educationLevelFk`) REFERENCES `educationLevel` (`id`) ON UPDATE CASCADE,