update structure db #9764
This commit is contained in:
parent
8f575fbc45
commit
2c9a10f277
|
@ -21,10 +21,10 @@
|
|||
}
|
||||
},
|
||||
"relations": {
|
||||
"worker": {
|
||||
"user": {
|
||||
"type": "belongsTo",
|
||||
"model": "Worker",
|
||||
"foreignKey": "workerFk"
|
||||
"model": "Account",
|
||||
"foreignKey": "userFk"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -16,3 +16,33 @@ ADD CONSTRAINT `fgn_worker`
|
|||
REFERENCES `vn2008`.`Trabajadores` (`Id_Trabajador`)
|
||||
ON DELETE CASCADE
|
||||
ON UPDATE CASCADE;
|
||||
|
||||
ALTER TABLE `salix`.`userTableConfiguration`
|
||||
DROP FOREIGN KEY `fgn_worker`;
|
||||
ALTER TABLE `salix`.`userTableConfiguration`
|
||||
CHANGE COLUMN `workerFk` `userFk` INT(10) NOT NULL ;
|
||||
ALTER TABLE `salix`.`userTableConfiguration`
|
||||
ADD CONSTRAINT `fgn_worker`
|
||||
FOREIGN KEY (`userFk`)
|
||||
REFERENCES `vn2008`.`Trabajadores` (`Id_Trabajador`)
|
||||
ON DELETE CASCADE
|
||||
ON UPDATE CASCADE;
|
||||
|
||||
ALTER TABLE `salix`.`userTableConfiguration`
|
||||
DROP FOREIGN KEY `fgn_worker`;
|
||||
ALTER TABLE `salix`.`userTableConfiguration`
|
||||
DROP INDEX `fgn_worker_idx` ;
|
||||
|
||||
|
||||
|
||||
ALTER TABLE `salix`.`userTableConfiguration`
|
||||
CHANGE COLUMN `userFk` `userFk` INT(10) UNSIGNED NOT NULL ;
|
||||
|
||||
ALTER TABLE `salix`.`userTableConfiguration`
|
||||
ADD INDEX `fgn_user_idx` (`userFk` ASC);
|
||||
ALTER TABLE `salix`.`userTableConfiguration`
|
||||
ADD CONSTRAINT `fgn_user`
|
||||
FOREIGN KEY (`userFk`)
|
||||
REFERENCES `account`.`user` (`id`)
|
||||
ON DELETE CASCADE
|
||||
ON UPDATE CASCADE;
|
||||
|
|
Loading…
Reference in New Issue