create table PHOTOGRAPH_CONTENT (
  `CONTENT` longblob NOT NULL,
  `ID_INTERNAL` int(11) NOT NULL auto_increment,
  `KEY_PHOTOGRAPH` int(11),
  `SIZE` text,
  primary key (ID_INTERNAL),
  index (KEY_PHOTOGRAPH)
) type=InnoDB ;

insert into PHOTOGRAPH_CONTENT (CONTENT, KEY_PHOTOGRAPH, SIZE)
select PHOTOGRAPH.CONTENT, PHOTOGRAPH.ID_INTERNAL, 'DOC_SIZE' from PHOTOGRAPH where PHOTOGRAPH.CONTENT IS NOT NULL;

insert into PHOTOGRAPH_CONTENT (CONTENT, KEY_PHOTOGRAPH, SIZE)
select PHOTOGRAPH.RAW_CONTENT, PHOTOGRAPH.ID_INTERNAL, 'RAW' from PHOTOGRAPH where PHOTOGRAPH.RAW_CONTENT IS NOT NULL;

alter table PHOTOGRAPH change column CONTENT CONTENT BLOB NULL;