/**Begin E:\NextERP_PDM\PDM_UPGRADE\PDMS\branch_lastest\pdm\EB_table.sql **/



IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_EB_REPORTATTACHMENT') 
 CREATE TABLE T_EB_REPORTATTACHMENT (
FID BIGINT DEFAULT 0 NOT NULL,
FNUMBER NVARCHAR(30) DEFAULT ' ' NOT NULL,
FNAME NVARCHAR(255) DEFAULT ' ' NOT NULL,
FMODELID BIGINT DEFAULT 0 NOT NULL,
FTYPE NVARCHAR(50) DEFAULT '1' NOT NULL,
FTASKPROID BIGINT DEFAULT 0 NOT NULL,
FTEMPLATEID BIGINT DEFAULT 0 NOT NULL,
FAREARANGE NVARCHAR(255) DEFAULT ' ' NOT NULL,
FMASTERID BIGINT DEFAULT 0 NOT NULL,
FREMARK NVARCHAR(255) DEFAULT ' ' NOT NULL,
FENABLE NVARCHAR(50) DEFAULT '1' NOT NULL,
FSTATUS NVARCHAR(50) DEFAULT 'A' NOT NULL,
FCREATETIME DATETIME,
FMODIFYTIME DATETIME,
FCREATORID BIGINT DEFAULT 0 NOT NULL,
FMODIFIERID BIGINT DEFAULT 0 NOT NULL
);


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


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

IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_EB_MODELUPLOAD_LOG' AND KSQL_COL_NAME ='FTARVERSION') 
 ALTER TABLE T_EB_MODELUPLOAD_LOG ADD (FTARVERSION NVARCHAR(50) DEFAULT ' ' NOT NULL );


/**End E:\NextERP_PDM\PDM_UPGRADE\PDMS\branch_lastest\pdm\EB_table.sql **/
