CREATE TABLE `workorders_pictures` (
  `id` BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT,
  `idworkorder` BIGINT(20) UNSIGNED NOT NULL,
  `description` VARCHAR(250) DEFAULT NULL,
  `picture` MEDIUMBLOB,
  `created` DATETIME NOT NULL,
  `modified` DATETIME NOT NULL,
  PRIMARY KEY (`id`),
  KEY `fk_workorder_picture` (`idworkorder`),
  CONSTRAINT `fk_workorder_picture` FOREIGN KEY (`idworkorder`) REFERENCES `workorders` (`id`)
) ;

ALTER TABLE workorders DROP COLUMN picture;

ALTER TABLE `workorders`   
  CHANGE `idaboutus` `idaboutus` BIGINT(20) UNSIGNED NULL,
  CHANGE `iddevicetype` `iddevicetype` BIGINT(20) UNSIGNED NULL;
  
ALTER TABLE `workorders`   
  ADD COLUMN `notes` VARCHAR(1000) NULL AFTER `signature`;
  
  
