data migration from claim.observation to claimObservations

This commit is contained in:
Carlos Jimenez Ruiz 2022-06-27 11:01:29 +02:00
parent d183ccb843
commit f1cb5a958c
2 changed files with 4 additions and 2 deletions

View File

@ -1,7 +1,7 @@
CREATE TABLE `vn`.`claimObservation` (
`id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT,
`claimFk` int(10) unsigned NOT NULL,
`workerFk` int(10) unsigned NOT NULL,
`workerFk` int(10) unsigned DEFAULT NULL,
`text` text COLLATE utf8_unicode_ci NOT NULL,
`created` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
PRIMARY KEY (`id`),
@ -10,4 +10,4 @@ CREATE TABLE `vn`.`claimObservation` (
KEY `claimObservation_created_IDX` (`created`) USING BTREE,
CONSTRAINT `claimObservation_ibfk_1` FOREIGN KEY (`claimFk`) REFERENCES `vn`.`claim` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
CONSTRAINT `claimObservation_ibfk_2` FOREIGN KEY (`workerFk`) REFERENCES `vn`.`worker` (`id`) ON UPDATE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci COMMENT='Todas las observaciones referentes a una reclamación'
) COMMENT='Todas las observaciones referentes a una reclamación'

View File

@ -0,0 +1,2 @@
INSERT INTO `vn`.`claimObservation` (`claimFk`, `text`, `created`)
SELECT `id`, `observation`, `created` FROM `vn`.`claim`