/**Begin D:\PDM_UPGRADE\PDM1\POM_table.sql **/
IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_IM_MDC_BFSTOCK') 
 CREATE TABLE T_IM_MDC_BFSTOCK (
FID BIGINT DEFAULT 0 NOT NULL,
FSOURCEBILLENTRYID BIGINT DEFAULT 0 NOT NULL,
FSTOCKENTRYID BIGINT DEFAULT 0 NOT NULL,
FSOURCEBILLENTRY NVARCHAR(50) DEFAULT ' ' NOT NULL,
FACTISSUEBFQTY BIGINT DEFAULT 0 NOT NULL,
FBFCLOSE CHAR(1) DEFAULT '0' NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_IM_MDC_BFLOGENTRY') 
 CREATE TABLE T_IM_MDC_BFLOGENTRY (
FID BIGINT DEFAULT 0 NOT NULL,
FENTRYID BIGINT DEFAULT 0 NOT NULL,
FSEQ BIGINT DEFAULT 0 NOT NULL,
FSOURCEBILLENTRY NVARCHAR(50) DEFAULT ' ' NOT NULL,
FSOURCEBILLENTRYID BIGINT DEFAULT 0 NOT NULL,
FSTOCKID BIGINT DEFAULT 0 NOT NULL,
FSOURCEBILLID BIGINT DEFAULT 0 NOT NULL,
FSTOCKENTRYID BIGINT DEFAULT 0 NOT NULL,
FSOURCEBILLNO NVARCHAR(50) DEFAULT ' ' NOT NULL,
FBILLSEQ NVARCHAR(50) DEFAULT ' ' NOT NULL,
FBIZTIME DATETIME,
FMATERIALID BIGINT DEFAULT 0 NOT NULL,
FMATERIELMASTERID BIGINT DEFAULT 0 NOT NULL,
FBFSTATUS NVARCHAR(50) DEFAULT ' ' NOT NULL,
FBFRES NVARCHAR(1000) DEFAULT ' ' NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_IM_MDC_BACKFLUSHLOG') 
 CREATE TABLE T_IM_MDC_BACKFLUSHLOG (
FID BIGINT DEFAULT 0 NOT NULL,
FBILLNO NVARCHAR(50) DEFAULT ' ' NOT NULL,
FBILLSTATUS NVARCHAR(50) DEFAULT ' ' NOT NULL,
FCREATORID BIGINT DEFAULT 0 NOT NULL,
FMODIFIERID BIGINT DEFAULT 0 NOT NULL,
FAUDITORID BIGINT DEFAULT 0 NOT NULL,
FAUDITDATE DATETIME,
FMODIFYTIME DATETIME,
FCREATETIME DATETIME,
FORGID BIGINT DEFAULT 0 NOT NULL
);



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