/**Begin D:\PDM_UPGRADE\PDM1\EB_table.sql **/
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_EB_DIMMATERULEAPP' AND KSQL_COL_NAME IN ('FSHOWNAME')) 
 ALTER TABLE T_EB_DIMMATERULEAPP ADD (FSHOWNAME NVARCHAR(255) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_EB_ANALYSISCHART' AND KSQL_COL_NAME IN ('FIMAGESRC')) 
 ALTER TABLE T_EB_ANALYSISCHART ADD (FIMAGESRC NVARCHAR(500) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_EB_ANALYSISCHART' AND KSQL_COL_NAME IN ('FIMAGENAME')) 
 ALTER TABLE T_EB_ANALYSISCHART ADD (FIMAGENAME NVARCHAR(500) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_EB_SCHEMECATALOG_L') 
 CREATE TABLE T_EB_SCHEMECATALOG_L (
FPKID NVARCHAR(10) DEFAULT ' ' NOT NULL,
FID BIGINT DEFAULT 0 NOT NULL,
FLOCALEID NVARCHAR(10) DEFAULT ' ' NOT NULL,
FNAME NVARCHAR(255) DEFAULT ' ' NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_EB_SCHEMEENTRY_L') 
 CREATE TABLE T_EB_SCHEMEENTRY_L (
FPKID NVARCHAR(10) DEFAULT ' ' NOT NULL,
FID BIGINT DEFAULT 0 NOT NULL,
FLOCALEID NVARCHAR(10) DEFAULT ' ' NOT NULL,
FNAME NVARCHAR(255) DEFAULT ' ' NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_EB_SCHEMEDIMMAP') 
 CREATE TABLE T_EB_SCHEMEDIMMAP (
FID BIGINT DEFAULT 0 NOT NULL,
FENTRYID BIGINT DEFAULT 0 NOT NULL,
FSEQ INT DEFAULT 0 NOT NULL,
FDIMPROP NVARCHAR(255) DEFAULT ' ' NOT NULL,
FDIMNUMBER NVARCHAR(255) DEFAULT ' ' NOT NULL,
FTARGETFIELDNAME NVARCHAR(255) DEFAULT ' ' NOT NULL,
FTARGETFIELDNUM NVARCHAR(255) DEFAULT ' ' NOT NULL,
FDIM BIGINT DEFAULT 0 NOT NULL,
FISPK CHAR(1) DEFAULT '0' NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_EB_SCHEMEENTRY') 
 CREATE TABLE T_EB_SCHEMEENTRY (
FID BIGINT DEFAULT 0 NOT NULL,
FTARGETTABLE BIGINT DEFAULT 0 NOT NULL,
FNUMBER NVARCHAR(255) DEFAULT ' ' NOT NULL,
FSCHEMECATALOG BIGINT DEFAULT 0 NOT NULL,
FMODIFIERFIELD BIGINT DEFAULT 0 NOT NULL,
FMODIFYDATEFIELD DATETIME,
FISCSCHEMETRIGGER BIGINT DEFAULT 0 NOT NULL
);



/**End D:\PDM_UPGRADE\PDM1\EB_table.sql **/
