/**Begin D:\k3Cloud\PDM_UPGRADE\PDM1\MDS_table.sql **/
IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_MDS_PLANDATAFIELD_ENTRY') 
 CREATE TABLE T_MDS_PLANDATAFIELD_ENTRY (
FID BIGINT DEFAULT 0 NOT NULL,
FENTRYID BIGINT DEFAULT 0 NOT NULL,
FSEQ BIGINT DEFAULT 0 NOT NULL,
FFIELDNAME NVARCHAR(80) DEFAULT ' ' NOT NULL,
FFIELDCODE NVARCHAR(80) DEFAULT ' ' NOT NULL,
FFIELDALIAS NVARCHAR(80) DEFAULT ' ' NOT NULL,
FFIELDNAMEB NVARCHAR(80) DEFAULT ' ' NOT NULL,
FFIELDCODEB NVARCHAR(80) DEFAULT ' ' NOT NULL,
FFIELDALIASB NVARCHAR(80) DEFAULT ' ' NOT NULL,
FISFREEZE CHAR(1) DEFAULT '0' NOT NULL,
FISUNIQUE CHAR(1) DEFAULT '0' NOT NULL,
FISHISTORYDATA CHAR(1) DEFAULT '0' NOT NULL,
FISCALC CHAR(1) DEFAULT '0' NOT NULL,
FISSYNC CHAR(1) DEFAULT '0' NOT NULL,
FISNEW CHAR(1) DEFAULT '0' NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_MDS_PLANDATAFIELDSET') 
 CREATE TABLE T_MDS_PLANDATAFIELDSET (
FID BIGINT DEFAULT 0 NOT NULL,
FNUMBER NVARCHAR(80) DEFAULT ' ' NOT NULL,
FNAME NVARCHAR(255) 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,
FISPRESET CHAR(1) DEFAULT '0' NOT NULL,
FMASTERID BIGINT DEFAULT 0 NOT NULL
);


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



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