/**BEGIN  **/
IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_EB_UPGRADESRECORD') 
CREATE TABLE T_EB_UPGRADESRECORD(
	FID BIGINT DEFAULT 0 NOT NULL,
	FSTATUS CHAR(1) DEFAULT '1' NOT NULL,
	FBEGINTIME DATETIME,
	FENDTIME DATETIME,
	FOPUSER BIGINT DEFAULT '0' NOT NULL,
	FREFMODELS NVARCHAR(2000)  DEFAULT ' ' NOT NULL
);

IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_EB_UPDETAILRECORD') 
CREATE TABLE T_EB_UPDETAILRECORD(
	FID BIGINT DEFAULT 0 NOT NULL,
	FENTRYID BIGINT DEFAULT 0 NOT NULL,
    FTASKSTATUS CHAR(1) DEFAULT '1' NOT NULL,
	FTASKKEY NVARCHAR(100) DEFAULT ' ' NOT NULL,
	FOPTIME DATETIME,
	FSEQ INT NOT NULL DEFAULT 0,
	FTIMECOST BIGINT DEFAULT '0' NOT NULL,
	FLOGINFO NVARCHAR(2000)  DEFAULT ' ' NOT NULL
);

 EXEC P_ALTERPK 'PK_T_EB_UPGRADESRECORD', 'T_EB_UPGRADESRECORD', 'FID', '1';
 EXEC P_ALTERPK 'PK_T_EB_UPDETAILRECORD', 'T_EB_UPDETAILRECORD', 'FENTRYID', '1';
 
/**END **/