XYZ


 table DEP_ATOM_SITE   
 table DEP_XYZ    
 table DEP_ANISO_SITE    
 table DEP_XYZ_ALT    
 table DEP_B_SITE   


create table DEP_ATOM_SITE ( AUTH_ID varchar2(8) not null, DEIC_DEIC_ID number(10,0) not null, DAS_ID number(10,0) not null, DEIC_AUTH_ID varchar2(8) null, DEIC_PDB_ID varchar2(3) null, PDB_GROUP varchar2(1) null, REF_CHEM_ATOM_ID number(10,0) null, DEP_CHEM_ATOM_ID number(10,0) null, RCF_RCF_ID number(10,0) null, DS2_DS2_ID number(10,0) null ) ;

create table DEP_XYZ ( DEP_DEP_ID number(10,0) not null, DX_ID number(10,0) not null, PDB_SERIAL varchar2(8) not null, CARTN_X number not null, CARTN_Y number not null, CARTN_Z number not null, DAS_DAS_ID number(10,0) not null, DM2_DM2_ID number(10,0) not null, DXA_DXA_ID number(10,0) null, OCCUPANCY float(27) default 1.0 null, SERIAL number(38) null, U_ISO_OR_EQUIV float(27) null, PDB_CHARGE number(38) null, PDB_ELEMENT varchar2(2) null, CARTN_X_ESD number null, CARTN_Y_ESD number null, CARTN_Z_ESD number null, WYCKOFF_SYMBOL varchar2(1) null ) ;

create table DEP_ANISO_SITE ( DA_DA_ID number(10,0) not null, DAS1_ID number(10,0) not null, DX_DX_ID number(10,0) not null, U11 number(8,0) null, U11_ESD number(8,0) null, U12 number(8,0) null, U12_ESD number(8,0) null, U13 number(8,0) null, U13_ESD number(8,0) null, U22 number(8,0) null, U22_ESD number(8,0) null, U23 number(8,0) null, U23_ESD number(8,0) null, RATIO number(8,0) null, U33 number(8,0) null, U33_ESD number(8,0) null, B_ISO_EQUIV number(8,0) null, B_ISO_EQUIV_ESD number(8,0) null, UG_EQUIV number(8,0) null, UG_EQUIV_ESD number(8,0) null ) ;

create table DEP_XYZ_ALT ( ID varchar2(8) not null, DM2_DM2_ID number(10,0) not null, DXA_ID number(10,0) not null, DETAILS varchar2(2000) null ) ;

create table DEP_B_SITE ( DA_DA_ID number(10,0) not null, DBS_ID number(10,0) not null, DAS_DAS_ID number(10,0) not null, OCCUPANCY number(8,0) not null, OCCUPANCY_ESD number(8,0) not null, U_ISO_EQUIV number(8,0) null, U_ISO_EQUIV_ESD number(8,0) null, BG_EQUIV number(8,0) null, BG_EQUIV_ESD number(8,0) null, RTDT_RTDT_ID number(10,0) null ) ;


alter table DEP_ATOM_SITE add (constraint DAS_PK primary key (DAS_ID)) alter table DEP_ATOM_SITE add ( constraint DAS_DAS2_UK unique (AUTH_ID ,DEIC_DEIC_ID)) add ( constraint DAS_DAS1_UK unique (DEIC_DEIC_ID , DEP_CHEM_ATOM_ID, REF_CHEM_ATOM_ID)) alter table DEP_ATOM_SITE add (constraint AVCON_1611777_PDB_G_000 check (PDB_GROUP IN ('A', 'H'))) alter table DEP_ATOM_SITE add constraint DAS_SCA_IS_DEFINED_BY_FK foreign key (DEP_CHEM_ATOM_ID) references REF_CHEM_ATOM (SCA_ID) on delete cascade add constraint DAS_DEIC_FK foreign key (DEIC_DEIC_ID) references DEP_ENTITY_INST_CMPNT (DEIC_ID) on delete cascade add constraint DAS_SCA_FK foreign key (REF_CHEM_ATOM_ID) references REF_CHEM_ATOM (SCA_ID) on delete cascade add constraint DAS_RCF_FK foreign key (RCF_RCF_ID) references REF_CALC_FLAG (RCF_ID) on delete cascade add constraint DAS_DS2_FK foreign key (DS2_DS2_ID) references DEP_SEGID (DS2_ID) on delete cascade alter table DEP_XYZ add (constraint DX_PK primary key (DX_ID)) alter table DEP_XYZ add ( constraint DX_DX1_UK unique (DM2_DM2_ID, DAS_DAS_ID, DXA_DXA_ID)) add ( constraint DX_DX2_UK unique (PDB_SERIAL, DEP_DEP_ID )) alter table DEP_XYZ add constraint DX_DAS_FK foreign key (DAS_DAS_ID) references DEP_ATOM_SITE (DAS_ID) on delete cascade add constraint DX_DM2_FK foreign key (DM2_DM2_ID) references DEP_MODEL (DM2_ID) on delete cascade add constraint DX_DEP_FK foreign key (DEP_DEP_ID ) references DEPOSITION (DEP_ID ) on delete cascade add constraint DX_DXA_FK foreign key (DXA_DXA_ID) references DEP_XYZ_ALT (DXA_ID) on delete cascade alter table DEP_ANISO_SITE add (constraint DAS1_PK primary key (DAS1_ID)) alter table DEP_ANISO_SITE add ( constraint DAS1_DAS11_UK unique (DA_DA_ID)) alter table DEP_ANISO_SITE add constraint DAS1_DA_FK foreign key (DA_DA_ID) references DEP_ASSEMBLY (DA_ID) on delete cascade add constraint DAS1_DX_FK foreign key (DX_DX_ID) references DEP_XYZ (DX_ID) on delete cascade alter table DEP_XYZ_ALT add (constraint DXA_PK primary key (DXA_ID)) alter table DEP_XYZ_ALT add ( constraint DXA_DXA1_UK unique (ID ,DM2_DM2_ID)) alter table DEP_XYZ_ALT add constraint DXA_DM2_FK foreign key (DM2_DM2_ID) references DEP_MODEL (DM2_ID) on delete cascade alter table DEP_B_SITE add (constraint DBS_PK primary key (DBS_ID)) alter table DEP_B_SITE add ( constraint DBS_DBS1_UK unique (DA_DA_ID)) alter table DEP_B_SITE add constraint DBS_RTDT_FK foreign key (RTDT_RTDT_ID) references REF_THERMAL_DISPLACE_TYPE (RTDT_ID) on delete cascade add constraint DBS_DAS_FK foreign key (DAS_DAS_ID) references DEP_ATOM_SITE (DAS_ID) on delete cascade add constraint DBS_DA_FK foreign key (DA_DA_ID) references DEP_ASSEMBLY (DA_ID) on delete cascade