From Harmless Lion, 6 Years ago, written in Plain Text.
Embed
  1. create table prod_file_to_migrate (
  2.        item_uuid VARCHAR2(100) not null,
  3.        version number(10) not null,
  4.        thread_id number(10),
  5.        error_details VARCHAR2(1000),
  6.        u_error_details VARCHAR2(1000),
  7.        filepath      VARCHAR2(500) NOT NULL,
  8.        enc_filepath  VARCHAR2(500) NULL,
  9.        filesize NUMBER(38) default 0 NOT NULL,
  10.        checksum VARCHAR2(1000),
  11.        c_status number(1) default 0,
  12.        status number(1) default 0, --0 for unmigrated, 1 for in progress, 2 for completed, -1 for error
  13.        u_status number(1) default 0, --0 for unmigrated, 1 for in progress, 2 for completed, -1 for error
  14.        src_collection_id VARCHAR2(100),
  15.        collection_id VARCHAR2(100),
  16.        school_reference number(1) default -1 -- -1 for dontcare, 0 for false, 1 for true
  17. );
  18.  
  19. create unique index file_to_migrate_pk on prod_file_to_migrate (item_uuid, version,filepath);
  20. create unique index prod_file_to_migrate_c_status on prod_file_to_migrate (c_status);
  21. create unique index prod_file_to_migrate_status on prod_file_to_migrate (status);
  22. create unique index prod_file_to_migrate_u_status on prod_file_to_migrate (u_status);
  23. create unique index prod_file_to_migrate_thread_id on prod_file_to_migrate (thread_id);
  24.  
  25.  
  26.  
  27. create table prod_school_file_to_migrate (
  28.        item_uuid VARCHAR2(100) not null,
  29.        version number(10) not null,
  30.        thread_id number(10),
  31.        error_details VARCHAR2(1000),
  32.        u_error_details VARCHAR2(1000),
  33.        filepath      VARCHAR2(500) NOT NULL,
  34.        enc_filepath  VARCHAR2(500) NULL,
  35.        filesize NUMBER(38) default 0 NOT NULL,
  36.        checksum VARCHAR2(1000),
  37.        c_status number(1) default 0,
  38.        status number(1) default 0, --0 for unmigrated, 1 for in progress, 2 for completed, -1 for error
  39.        u_status number(1) default 0, --0 for unmigrated, 1 for in progress, 2 for completed, -1 for error
  40.        src_collection_id VARCHAR2(100),
  41.        collection_id VARCHAR2(100),
  42.        school_reference number(1) default -1 -- -1 for dontcare, 0 for false, 1 for true
  43. );
  44.  
  45.  
  46. create unique index prod_school_file_to_migrate_px on prod_school_file_to_migrate (item_uuid, version,filepath);
  47. create unique index prod_school_file_to_migrate_c_status on prod_school_file_to_migrate (c_status);
  48. create unique index prod_school_file_to_migrate_status on prod_school_file_to_migrate (status);
  49. create unique index prod_school_file_to_migrate_u_status on prod_school_file_to_migrate (u_status);
  50. create unique index prod_school_file_to_migrate_thread_id on prod_school_file_to_migrate (thread_id);
  51.  
  52.  
  53.