/**BEGIN  **/

IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_EB_OPERATIONLOG') 
CREATE TABLE T_EB_OPERATIONLOG
(
    FID           	BIGINT DEFAULT 0 NOT NULL,
	FCREATORID      BIGINT DEFAULT 0 NOT NULL,
	FCREATETIME   	DATETIME,
    FTRACEID		NVARCHAR(50)  DEFAULT ' ' NOT NULL,
	FOPERATION		NVARCHAR(50)  DEFAULT ' ' NOT NULL,
	FDESCRIPTION	NVARCHAR(255)  DEFAULT ' ' NOT NULL,
	FENTITYNUMBER	NVARCHAR(50)  DEFAULT ' ' NOT NULL
);

-- 主键
EXEC P_ALTERPK 'PK_EB_OPERATIONLOG', 'T_EB_OPERATIONLOG', 'FID', '1';

-- 索引
IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IX_EB_OPERATIONLOG_TRACE')
CREATE INDEX IX_EB_OPERATIONLOG_TRACE ON T_EB_OPERATIONLOG ( FTRACEID );

IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IX_EB_OPERATIONLOG_TIME')
CREATE INDEX IX_EB_OPERATIONLOG_TIME ON T_EB_OPERATIONLOG ( FCREATETIME );

IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IX_EB_OPERATIONLOG_USER')
CREATE INDEX IX_EB_OPERATIONLOG_USER ON T_EB_OPERATIONLOG ( FCREATORID );

