Untitled

mail@pastecode.io avatar
unknown
plain_text
2 years ago
8.8 kB
3
Indexable
Never
CREATE TABLE UHC_CONTRACT_CONDITION
( 
	Condition_Sid        varchar(1024)  NOT NULL ,
	Condition_Id         varchar(1024)  NOT NULL ,
	Record_Version_TS    timestamp  NOT NULL ,
	Start_Date           date  NOT NULL ,
	End_Date             date  NULL ,
	Action_Condition_Text varchar(4096)  NULL ,
	State_Condition_Text varchar(4096)  NULL ,
	Market_Condition_Text varchar(4096)  NULL ,
	Paper_Type_Condition_Text varchar(4096)  NULL ,
	National_Condition_Text varchar(4096)  NULL ,
	CS_Only_Condition_Text varchar(4096)  NULL ,
	Affiliation_Condition_Text varchar(4096)  NULL ,
	Include_Exclude_Condition_Text varchar(4096)  NULL ,
	Create_User_Id       varchar(1024)  NOT NULL ,
	Create_TS            timestamp  NOT NULL ,
	Update_User_Id       varchar(1024)  NULL ,
	Update_TS            timestamp  NULL ,
	File_Version_TS      timestamp  NULL ,
	Search_Tag_Name      varchar(1024)  NULL 
);

ALTER TABLE UHC_CONTRACT_CONDITION
	ADD CONSTRAINT CONTRACT_CONDITION_PK PRIMARY KEY (Condition_Sid);

ALTER TABLE UHC_CONTRACT_CONDITION
	ADD CONSTRAINT CONTRACT_CONDITION_AK UNIQUE (Condition_Id,Record_Version_TS);

CREATE TABLE UHC_CONTRACT_LANGUAGE
( 
	Language_Sid         varchar(1024)  NOT NULL ,
	Language_Id          varchar(1024)  NOT NULL ,
	Record_Version_TS    timestamp  NOT NULL ,
	Language_Code        varchar(64)  NOT NULL ,
	Subject_Sid          varchar(1024)  NOT NULL ,
	Conformity_Code      varchar(64)  NOT NULL ,
	Start_Date           date  NOT NULL ,
	End_Date             date  NULL ,
	Language_Title_Name  varchar(1024)  NULL ,
	Language_Summary_Text varchar(4096)  NULL ,
	Language_Text        text  NULL ,
	Language_Text_Length_Number smallint  NULL ,
	Language_XML         text  NULL ,
	Precondition_Variable_Name varchar(1024)  NULL ,
	Template_Process_Group_Text varchar(4096)  NULL ,
	Create_User_Id       varchar(1024)  NOT NULL ,
	Create_TS            timestamp  NOT NULL ,
	Update_User_Id       varchar(1024)  NULL ,
	Update_TS            timestamp  NULL ,
	File_Version_TS      timestamp  NULL ,
	Search_Tag_Name      varchar(1024)  NULL 
);

ALTER TABLE UHC_CONTRACT_LANGUAGE
	ADD CONSTRAINT CONTRACT_LANGUAGE_PK PRIMARY KEY (Language_Sid);

ALTER TABLE UHC_CONTRACT_LANGUAGE
	ADD CONSTRAINT CONTRACT_LANGUAGE_AK1 UNIQUE (Language_Id,Record_Version_TS);

CREATE INDEX CONTRACT_LANGUAGE_AK2 ON UHC_CONTRACT_LANGUAGE
( 
	Language_Code ASC
);

CREATE INDEX CONTRACT_LANGUAGE_FK ON UHC_CONTRACT_LANGUAGE
( 
	Subject_Sid ASC
);

CREATE TABLE UHC_CONTRACT_LANGUAGE_CONDITION_RELATIONSHIP
( 
	Language_Condition_Sid varchar(1024)  NOT NULL ,
	Language_Sid         varchar(1024)  NOT NULL ,
	Condition_Sid        varchar(1024)  NOT NULL ,
	Record_Version_TS    timestamp  NULL ,
	Start_Date           date  NOT NULL ,
	End_Date             date  NULL ,
	Create_User_Id       varchar(1024)  NOT NULL ,
	Create_TS            timestamp  NOT NULL ,
	Update_User_Id       varchar(1024)  NULL ,
	Update_TS            timestamp  NULL ,
	File_Version_TS      timestamp  NULL ,
	Search_Tag_Name      varchar(1024)  NULL 
);

ALTER TABLE UHC_CONTRACT_LANGUAGE_CONDITION_RELATIONSHIP
	ADD CONSTRAINT CONTRACT_LANGUAGE_CONDITION_RELATIONSHIP_PK PRIMARY KEY (Language_Condition_Sid);

ALTER TABLE UHC_CONTRACT_LANGUAGE_CONDITION_RELATIONSHIP
	ADD CONSTRAINT CONTRACT_LANGUAGE_CONDITION_RELATIONSHIP_AK UNIQUE (Language_Sid,Condition_Sid,Record_Version_TS);

CREATE INDEX CONTRACT_LANGUAGE_CONDITION_RELATIONSHIP_FK1 ON UHC_CONTRACT_LANGUAGE_CONDITION_RELATIONSHIP
( 
	Language_Sid ASC
);

CREATE INDEX CONTRACT_LANGUAGE_CONDITION_RELATIONSHIP_FK2 ON UHC_CONTRACT_LANGUAGE_CONDITION_RELATIONSHIP
( 
	Condition_Sid ASC
);

CREATE TABLE UHC_CONTRACT_LANGUAGE_SUBJECT
( 
	Subject_Sid          varchar(1024)  NOT NULL ,
	Parent_Subject_Sid   varchar(1024)  NULL ,
	Subject_Id           varchar(1024)  NULL ,
	Record_Version_TS    timestamp  NULL ,
	Subject_Code         varchar(64)  NOT NULL ,
	Start_Date           date  NOT NULL ,
	End_Date             date  NULL ,
	Subject_Name         varchar(1024)  NOT NULL ,
	Subject_Text         varchar(4096)  NULL ,
	Subject_Class_Text   varchar(1024)  NULL ,
	Reference_Identification_Text varchar(1024)  NULL ,
	Create_User_Id       varchar(1024)  NOT NULL ,
	Create_TS            timestamp  NOT NULL ,
	Update_User_Id       varchar(1024)  NULL ,
	Update_TS            timestamp  NULL ,
	File_Version_TS      timestamp  NULL ,
	Search_Tag_Name      varchar(1024)  NULL 
);

ALTER TABLE UHC_CONTRACT_LANGUAGE_SUBJECT
	ADD CONSTRAINT CONTRACT_LANGUAGE_SUBJECT_PK PRIMARY KEY (Subject_Sid);

ALTER TABLE UHC_CONTRACT_LANGUAGE_SUBJECT
	ADD CONSTRAINT CONTRACT_LANGUAGE_SUBJECT_AK1 UNIQUE (Subject_Id,Record_Version_TS);

CREATE INDEX CONTRACT_LANGUAGE_SUBJECT_FK ON UHC_CONTRACT_LANGUAGE_SUBJECT
( 
	Parent_Subject_Sid ASC
);

CREATE INDEX CONTRACT_LANGUAGE_SUBJECT_AK2 ON UHC_CONTRACT_LANGUAGE_SUBJECT
( 
	Subject_Code ASC
);

CREATE TABLE UHC_CONTRACT_PRODUCT
( 
	Product_Sid          varchar(1024)  NOT NULL ,
	Product_Id           varchar(1024)  NOT NULL ,
	Record_Version_TS    timestamp  NOT NULL ,
	Product_Code         varchar(64)  NOT NULL ,
	Product_Category_Code varchar(64)  NOT NULL ,
	Product_Customer_Group_Name varchar(1024)  NOT NULL ,
	Product_Customer_Group_Sequence_Number smallint  NOT NULL ,
	Product_Name         varchar(1024)  NOT NULL ,
	Start_Date           date  NOT NULL ,
	End_Date             date  NULL ,
	Product_Inclusion_Description varchar(4096)  NULL ,
	Product_Inclusion_Definition_Text varchar(4096)  NULL ,
	Product_Exclusion_Description varchar(4096)  NULL ,
	Product_Exclusion_Definition_Text varchar(4096)  NULL ,
	License_State_Name   varchar(1024)  NULL ,
	Legal_Entities_Group_Name varchar(1024)  NULL ,
	Product_Manual_Indicator varchar(64)  NULL ,
	Create_User_Id       varchar(1024)  NOT NULL ,
	Create_TS            timestamp  NOT NULL ,
	Update_User_Id       varchar(1024)  NULL ,
	Update_TS            timestamp  NULL ,
	File_Version_TS      timestamp  NULL ,
	Search_Tag_Name      varchar(1024)  NULL 
);

ALTER TABLE UHC_CONTRACT_PRODUCT
	ADD CONSTRAINT CONTRACT_PRODUCT_PK PRIMARY KEY (Product_Sid);

ALTER TABLE UHC_CONTRACT_PRODUCT
	ADD CONSTRAINT CONTRACT_PRODUCT_AK1 UNIQUE (Product_Id,Record_Version_TS);

CREATE INDEX CONTRACT_PRODUCT_AK2 ON UHC_CONTRACT_PRODUCT
( 
	Product_Code ASC
);

CREATE TABLE UHC_CONTRACT_PRODUCT_CONDITION_RELATIONSHIP
( 
	Product_Condition_Sid varchar(1024)  NOT NULL ,
	Product_Sid          varchar(1024)  NOT NULL ,
	Condition_Sid        varchar(1024)  NOT NULL ,
	Record_Version_TS    timestamp  NOT NULL ,
	Start_Date           date  NOT NULL ,
	End_Date             date  NULL ,
	Create_User_Id       varchar(1024)  NOT NULL ,
	Create_TS            timestamp  NOT NULL ,
	Update_User_Id       varchar(1024)  NULL ,
	Update_TS            timestamp  NULL ,
	File_Version_TS      timestamp  NULL ,
	Search_Tag_Name      varchar(1024)  NULL 
);

ALTER TABLE UHC_CONTRACT_PRODUCT_CONDITION_RELATIONSHIP
	ADD CONSTRAINT CONTRACT_PRODUCT_CONDITION_RELATIONSHIP_PK PRIMARY KEY (Product_Condition_Sid);

ALTER TABLE UHC_CONTRACT_PRODUCT_CONDITION_RELATIONSHIP
	ADD CONSTRAINT CONTRACT_PRODUCT_CONDITION_RELATIONSHIP_AK UNIQUE (Product_Sid,Condition_Sid,Record_Version_TS);

CREATE INDEX CONTRACT_PRODUCT_CONDITION_RELATIONSHIP_FK1 ON UHC_CONTRACT_PRODUCT_CONDITION_RELATIONSHIP
( 
	Product_Sid ASC
);

CREATE INDEX CONTRACT_PRODUCT_CONDITION_RELATIONSHIP_FK2 ON UHC_CONTRACT_PRODUCT_CONDITION_RELATIONSHIP
( 
	Condition_Sid ASC
);


ALTER TABLE UHC_CONTRACT_LANGUAGE
	ADD CONSTRAINT CONTRACT_LANGUAGE_FK FOREIGN KEY (Subject_Sid) REFERENCES UHC_CONTRACT_LANGUAGE_SUBJECT(Subject_Sid);


ALTER TABLE UHC_CONTRACT_LANGUAGE_CONDITION_RELATIONSHIP
	ADD CONSTRAINT CONTRACT_LANGUAGE_CONDITION_RELATIONSHIP_FK1 FOREIGN KEY (Language_Sid) REFERENCES UHC_CONTRACT_LANGUAGE(Language_Sid);

ALTER TABLE UHC_CONTRACT_LANGUAGE_CONDITION_RELATIONSHIP
	ADD CONSTRAINT CONTRACT_LANGUAGE_CONDITION_RELATIONSHIP_FK2 FOREIGN KEY (Condition_Sid) REFERENCES UHC_CONTRACT_CONDITION(Condition_Sid);


ALTER TABLE UHC_CONTRACT_LANGUAGE_SUBJECT
	ADD CONSTRAINT CONTRACT_LANGUAGE_SUBJECT_FK FOREIGN KEY (Parent_Subject_Sid) REFERENCES UHC_CONTRACT_LANGUAGE_SUBJECT(Subject_Sid);


ALTER TABLE UHC_CONTRACT_PRODUCT_CONDITION_RELATIONSHIP
	ADD CONSTRAINT CONTRACT_PRODUCT_CONDITION_RELATIONSHIP_FK1 FOREIGN KEY (Product_Sid) REFERENCES UHC_CONTRACT_PRODUCT(Product_Sid);

ALTER TABLE UHC_CONTRACT_PRODUCT_CONDITION_RELATIONSHIP
	ADD CONSTRAINT CONTRACT_PRODUCT_CONDITION_RELATIONSHIP_FK2 FOREIGN KEY (Condition_Sid) REFERENCES UHC_CONTRACT_CONDITION(Condition_Sid);