/**Begin C:\Users\RD_jerry_wz_wang\Desktop\PDM_UPGRADE\pdm1\MDS_table.sql **/
IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_MDS_SETOFFFIELDSET_L')
CREATE TABLE T_MDS_SETOFFFIELDSET_L (
    FID BIGINT DEFAULT 0 NOT NULL,
    FPKID VARCHAR(36) DEFAULT ' ' 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_MDS_SETOFFFIELDSET_E_L')
CREATE TABLE T_MDS_SETOFFFIELDSET_E_L (
    FSRCFIELDNAME NVARCHAR(100) DEFAULT ' ' NOT NULL,
    FPKID VARCHAR(36) DEFAULT ' ' NOT NULL,
    FLOCALEID VARCHAR(10) DEFAULT ' ' NOT NULL,
    FTARGETFIELDNAME NVARCHAR(100) DEFAULT ' ' NOT NULL,
    FENTRYID BIGINT DEFAULT 0 NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_MDS_SETOFFFIELDSET_E')
CREATE TABLE T_MDS_SETOFFFIELDSET_E (
    FID BIGINT DEFAULT 0 NOT NULL,
    FSRCFIELDNAME NVARCHAR(100) DEFAULT ' ' NOT NULL,
    FSRCFIELDKEY NVARCHAR(50) DEFAULT ' ' NOT NULL,
    FTARGETFIELDKEY NVARCHAR(50) DEFAULT ' ' NOT NULL,
    FTARGETFIELDNAME NVARCHAR(100) DEFAULT ' ' NOT NULL,
    FSOURCETYPEID VARCHAR(50) DEFAULT ' ' NOT NULL,
    FENTRYID BIGINT DEFAULT 0 NOT NULL,
    FSEQ BIGINT DEFAULT 0 NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_MDS_SETOFFFIELDSET')
CREATE TABLE T_MDS_SETOFFFIELDSET (
    FNUMBER NVARCHAR(80) DEFAULT ' ' NOT NULL,
    FMASTERID BIGINT DEFAULT 0 NOT NULL,
    FCREATORID BIGINT DEFAULT 0 NOT NULL,
    FCREATETIME DATETIME,
    FMODIFYTIME DATETIME,
    FENABLE VARCHAR(10) DEFAULT ' ' NOT NULL,
    FMODIFIERID BIGINT DEFAULT 0 NOT NULL,
    FEFFECT CHAR(1) DEFAULT '0' NOT NULL,
    FNAME NVARCHAR(100) DEFAULT ' ' NOT NULL,
    FID BIGINT DEFAULT 0 NOT NULL,
    FSTATUS VARCHAR(10) DEFAULT ' ' NOT NULL
);


/**End C:\Users\RD_jerry_wz_wang\Desktop\PDM_UPGRADE\pdm1\MDS_table.sql **/
