tee ./Tables/WKF_INST_HIST.log

--------------------------------------------------------
--  DDL for Table WKF_INST_HIST
--------------------------------------------------------

  CREATE TABLE WKF_INST_HIST 
   (	WKF_INST_ID INT, 
	STATUS_ID SMALLINT, 
	CREATED_DATE DATETIME(6) , 
	CREATED_BY VARCHAR(30), 
	UPDATED_DATE DATETIME(6) , 
	UPDATED_BY VARCHAR(30), 
	MODULE_ID SMALLINT DEFAULT 2 , 
	SYSCREATED_DATE DATETIME(6) ,
	SYSUPDATED_DATE DATETIME(6) ,
	WKF_STAGE_CONFIG_ID MEDIUMINT, 
	COMMENTS VARCHAR(1000), 
	IS_LOCKED VARCHAR(1), 
	LOCKED_BY VARCHAR(100), 
	RECORD_DATE DATETIME(6), 
	VERSION INT, 
	ASSIGNED_TO VARCHAR(100), 
	HISTORY_CREATED_DATE DATETIME(6) DEFAULT CURRENT_TIMESTAMP(6),
	HISTORY_CREATED_BY VARCHAR(100), 
	HISTORY_UPDATED_DATE DATETIME(6) DEFAULT CURRENT_TIMESTAMP(6),
	HISTORY_UPDATED_BY VARCHAR(100)
   ) ;
--------------------------------------------------------
--  DDL for Index WKF_INST_HIST_PK
--------------------------------------------------------

  CREATE UNIQUE INDEX WKF_INST_HIST_PK ON WKF_INST_HIST (WKF_INST_ID, RECORD_DATE);
--------------------------------------------------------
--  Constraints for Table WKF_INST_HIST
--------------------------------------------------------

  ALTER TABLE WKF_INST_HIST ADD CONSTRAINT WKF_INST_HIST_PK PRIMARY KEY (WKF_INST_ID, RECORD_DATE);
  ALTER TABLE WKF_INST_HIST MODIFY CREATED_DATE DATETIME(6) NOT NULL;
  ALTER TABLE WKF_INST_HIST MODIFY CREATED_BY VARCHAR(30) NOT NULL;
  ALTER TABLE WKF_INST_HIST MODIFY UPDATED_DATE DATETIME(6) NOT NULL;
  ALTER TABLE WKF_INST_HIST MODIFY UPDATED_BY VARCHAR(30) NOT NULL;
  
notee
