--
delete from DBUpdate where id=2220;
--
insert into DBUpdate(id,author,description,update_date) 
  values (2220,'Lvi','Таблица архива экспортируемых документов',SYSDATE);
--
create table exch_document (
    exch_name varchar(30) not null,
    exch_date timestamp not null,
    exch_packet numeric(15) not null,
    exch_number numeric(15) not null,
    exch_type smallint default 0,
    exch_restore smallint default 0,
    exch_error varchar(500),
    exch_documentref numeric(15) not null,
    exch_classref numeric(15) not null,
    exch_create_userref numeric(15) not null,
    exch_restore_userref numeric(15)  default 0,
    constraint uq_exch_number unique (exch_name, exch_date, exch_number),
    constraint uq_exch_documentref unique (exch_documentref, exch_classref, exch_restore)
)
