create table REVISIONS
(
  REVISIONID           char(20)        not null,
  REVISSURVEID         char(20)        not null,
  REVISINUMBER         integer         not null,
  REVISIONDATE         timestamp       not null,
  REVISIONOTES         varchar(1000)  
) ;
alter table REVISIONS add constraint REVISIONS_PK primary key (REVISIONID) ;
delete from ZZ_OBJECTS where I_OBJECT='830CE448-151E-4EF7-BD2E-F791F02CA2A7' ;
delete from ZZ_OBJECTS where P_OBJECT='830CE448-151E-4EF7-BD2E-F791F02CA2A7' ;
insert into ZZ_OBJECTS (I_OBJECT, P_OBJECT, TYPE, ATTRIB, IDENT, R_OBJECT) values ('830CE448-151E-4EF7-BD2E-F791F02CA2A7', '0DE2AEC0-1103-41E7-AA17-48B34081504A', 'T', '', 'REVISIONS', '') ;
insert into ZZ_OBJECTS (I_OBJECT, P_OBJECT, TYPE, ATTRIB, IDENT, R_OBJECT) values ('FAC3E7E4-CC6D-4F50-978F-1DA85AD2C7F1', '830CE448-151E-4EF7-BD2E-F791F02CA2A7', 'F', 'YN120020NN', 'REVISIONID', '000000000000000000') ;
insert into ZZ_OBJECTS (I_OBJECT, P_OBJECT, TYPE, ATTRIB, IDENT, R_OBJECT) values ('FF576946-CB37-48EC-B274-CE4F20FFCA23', '830CE448-151E-4EF7-BD2E-F791F02CA2A7', 'F', 'NN120020NN', 'REVISSURVEID', '000000000000000000') ;
insert into ZZ_OBJECTS (I_OBJECT, P_OBJECT, TYPE, ATTRIB, IDENT, R_OBJECT) values ('5FCCA06B-E88C-4697-BE70-E9DAA671C718', '830CE448-151E-4EF7-BD2E-F791F02CA2A7', 'F', 'NN010009NN', 'REVISINUMBER', '000000000000000000') ;
insert into ZZ_OBJECTS (I_OBJECT, P_OBJECT, TYPE, ATTRIB, IDENT, R_OBJECT) values ('3094E0E6-9AD9-4BC3-9CB4-4AC7A7E1E557', '830CE448-151E-4EF7-BD2E-F791F02CA2A7', 'F', 'NN060016NN', 'REVISIONDATE', '000000000000000000') ;
insert into ZZ_OBJECTS (I_OBJECT, P_OBJECT, TYPE, ATTRIB, IDENT, R_OBJECT) values ('B55EB37D-FFB1-4BC2-AF8C-773938C8D9F9', '830CE448-151E-4EF7-BD2E-F791F02CA2A7', 'F', 'NY051000NN', 'REVISIONOTES', '000000000000000000') ;

alter table SURVEYS add SURVLASTREMA timestamp    ;
insert into ZZ_OBJECTS (I_OBJECT, P_OBJECT, TYPE, ATTRIB, IDENT, R_OBJECT) values ('B9ED5429-A82E-4715-B2C5-60800CFE0BFA', 'E8991382-95AA-4071-86E3-A67FF221C0F8', 'F', 'NY060010NN', 'SURVLASTREMA', '000000000000000000') ;

alter table REVISIONS add constraint REVISISURVEY foreign key (REVISSURVEID) references SURVEYTEMPLA (SURVEYTEMPID)  ;
insert into ZZ_OBJECTS (I_OBJECT, P_OBJECT, TYPE, ATTRIB, IDENT, R_OBJECT) values ('98E2F1EE-A2C6-41E4-B316-A41C1329E36C', '830CE448-151E-4EF7-BD2E-F791F02CA2A7', 'L', '11N', 'REVISISURVEY', '2912E030-F3C0-4282-BB18-6F3B1D240F52') ;
