/**Begin D:\PDM_UPGRADE\PDM1\EB_table.sql **/
IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_EB_BGDECOMPOSE') 
 CREATE TABLE T_EB_BGDECOMPOSE (
FID BIGINT DEFAULT 0 NOT NULL,
FMASTERID BIGINT DEFAULT 0 NOT NULL,
FBILLNUMBER NVARCHAR(100) DEFAULT ' ' NOT NULL,
FMODELID BIGINT DEFAULT 0 NOT NULL,
FBGAPPLYSCHEME BIGINT DEFAULT 0 NOT NULL,
FYEAR BIGINT DEFAULT 0 NOT NULL,
FMONEYUNIT NVARCHAR(30) DEFAULT ' ' NOT NULL,
FORG BIGINT DEFAULT 0 NOT NULL,
FDECOMPOSEPERSON BIGINT DEFAULT 0 NOT NULL,
FBILLTYPE NVARCHAR(30) DEFAULT ' ' NOT NULL,
FVERSION BIGINT DEFAULT 0 NOT NULL,
FDATATYPE BIGINT DEFAULT 0 NOT NULL,
FSOURCEBILLID NVARCHAR(100) DEFAULT ' ' NOT NULL,
FDECOMPOSESCHEME BIGINT DEFAULT 0 NOT NULL,
FREMARK NVARCHAR(255) DEFAULT ' ',
FCREATETIME DATETIME,
FMODIFYTIME DATETIME,
FAUDITDATE DATETIME,
FCREATORID BIGINT DEFAULT 0 NOT NULL,
FMODIFIERID BIGINT DEFAULT 0 NOT NULL,
FAUDITOR BIGINT DEFAULT 0 NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_EB_DECOMPOSESCHEME') 
 CREATE TABLE T_EB_DECOMPOSESCHEME (
FID BIGINT DEFAULT 0 NOT NULL,
FNUMBER NVARCHAR(30) DEFAULT ' ' NOT NULL,
FSTATUS CHAR(1) DEFAULT 'A' NOT NULL,
FCREATORID BIGINT DEFAULT 0 NOT NULL,
FMODIFIERID BIGINT DEFAULT 0 NOT NULL,
FENABLE CHAR(1) DEFAULT '1' NOT NULL,
FCREATETIME DATETIME,
FMODIFYTIME DATETIME,
FMASTERID BIGINT DEFAULT 0 NOT NULL,
FRELEASEORGID BIGINT DEFAULT 0 NOT NULL,
FMODELID BIGINT DEFAULT 0 NOT NULL
);


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


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_EB_DECOMSCHEME_ENTRY') 
 CREATE TABLE T_EB_DECOMSCHEME_ENTRY (
FID BIGINT DEFAULT 0 NOT NULL,
FENTRYID BIGINT DEFAULT 0 NOT NULL,
FSEQ INT DEFAULT 0 NOT NULL,
FDECOMPOSEORGID BIGINT DEFAULT 0 NOT NULL,
FDECOMPOSEPERSONID BIGINT DEFAULT 0 NOT NULL
);

 --- drop TABLE --------- 不允许删除表T_EB_DADASSDF，请恢复pdm ------------------- 

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