/**Begin D:\k3Cloud\PDM_UPGRADE\PDM1\MDS_table.sql **/
IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_MRP_RES_SCHEME') 
 CREATE TABLE T_MRP_RES_SCHEME (
FID BIGINT DEFAULT 0 NOT NULL,
FNUMBER VARCHAR(80) DEFAULT ' ' NOT NULL,
FNAME NVARCHAR(100) DEFAULT ' ' NOT NULL,
FSTATUS VARCHAR(5) DEFAULT ' ' NOT NULL,
FCREATORID BIGINT DEFAULT 0 NOT NULL,
FMODIFIERID BIGINT DEFAULT 0 NOT NULL,
FENABLE VARCHAR(5) DEFAULT ' ' NOT NULL,
FCREATETIME DATETIME,
FMODIFYTIME DATETIME,
FMASTERID BIGINT DEFAULT 0 NOT NULL,
FCREATEORGID BIGINT DEFAULT 0 NOT NULL,
FORGID BIGINT DEFAULT 0 NOT NULL,
FCTRLSTRATEGY NVARCHAR(30) DEFAULT ' ' NOT NULL,
FSOURCEDATAID BIGINT DEFAULT 0 NOT NULL,
FBITINDEX BIGINT DEFAULT 0 NOT NULL,
FSOURCEBITINDEX BIGINT DEFAULT 0 NOT NULL,
FISREPLACE CHAR(1) DEFAULT '0' NOT NULL,
FISADJUST CHAR(1) DEFAULT '0' NOT NULL,
FPLANMODEL BIGINT DEFAULT 0 NOT NULL,
FCHKGROUPPLAN VARCHAR(5) DEFAULT ' ' NOT NULL,
FPLANDAY BIGINT DEFAULT 0 NOT NULL,
FLISTMODEL BIGINT DEFAULT 0 NOT NULL,
FCHKGROUPLIST VARCHAR(5) DEFAULT ' ' NOT NULL,
FLISTDAY BIGINT DEFAULT 0 NOT NULL,
FPLANOUTLOOK BIGINT DEFAULT 0 NOT NULL,
FCHKGROUPPLANTYPE VARCHAR(5) DEFAULT ' ' NOT NULL,
FREQMODEL BIGINT DEFAULT 0 NOT NULL,
FCHKGROUPREQ VARCHAR(5) DEFAULT ' ' NOT NULL,
FREQDAY BIGINT DEFAULT 0 NOT NULL,
FSUPPLYMODEL BIGINT DEFAULT 0 NOT NULL,
FCHKGROUPSUPPLY VARCHAR(5) DEFAULT ' ' NOT NULL,
FSUPPLYDAY BIGINT DEFAULT 0 NOT NULL
);


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


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_MRP_RES_SCHLIST') 
 CREATE TABLE T_MRP_RES_SCHLIST (
FID BIGINT DEFAULT 0 NOT NULL,
FENTRYID BIGINT DEFAULT 0 NOT NULL,
FSEQ BIGINT DEFAULT 0 NOT NULL,
FLISTINRUN CHAR(1) DEFAULT '0' NOT NULL,
FLISTRESOURCE BIGINT DEFAULT 0 NOT NULL,
FLISTFIELDTRAN BIGINT DEFAULT 0 NOT NULL
);


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


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_MRP_RES_SCHPLAN') 
 CREATE TABLE T_MRP_RES_SCHPLAN (
FID BIGINT DEFAULT 0 NOT NULL,
FENTRYID BIGINT DEFAULT 0 NOT NULL,
FSEQ BIGINT DEFAULT 0 NOT NULL,
FPLANINRUN CHAR(1) DEFAULT '0' NOT NULL,
FPLANRESOURCE BIGINT DEFAULT 0 NOT NULL,
FPLANFIELDTRAN BIGINT DEFAULT 0 NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_MRP_RES_SCHREQ') 
 CREATE TABLE T_MRP_RES_SCHREQ (
FID BIGINT DEFAULT 0 NOT NULL,
FENTRYID BIGINT DEFAULT 0 NOT NULL,
FSEQ BIGINT DEFAULT 0 NOT NULL,
FREQINRUN CHAR(1) DEFAULT '0' NOT NULL,
FREQRESOURCE BIGINT DEFAULT 0 NOT NULL,
FREQFIELDTRAN BIGINT DEFAULT 0 NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_MRP_RES_SCHSUPPLY') 
 CREATE TABLE T_MRP_RES_SCHSUPPLY (
FID BIGINT DEFAULT 0 NOT NULL,
FENTRYID BIGINT DEFAULT 0 NOT NULL,
FSEQ BIGINT DEFAULT 0 NOT NULL,
FSUPPLYINRUN CHAR(1) DEFAULT '0' NOT NULL,
FSUPPLYRESOURCE BIGINT DEFAULT 0 NOT NULL,
FSUPPLYFIELDTRAN BIGINT DEFAULT 0 NOT NULL
);



/**End D:\k3Cloud\PDM_UPGRADE\PDM1\MDS_table.sql **/
