/**Begin E:\NextERP_PDM\PDM_UPGRADE\PDMS\branch_lastest\pdm\HPDI_table.sql **/
IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_HPDI_SUBAPISET') 
 CREATE TABLE T_HPDI_SUBAPISET (
FID BIGINT DEFAULT 0 NOT NULL,
FNUMBER VARCHAR(60) DEFAULT ' ' NOT NULL,
FNAME NVARCHAR(100) DEFAULT ' ' NOT NULL,
FSIMPLENAME NVARCHAR(100) DEFAULT ' ' NOT NULL,
FSTATUS VARCHAR(2) DEFAULT 'C' NOT NULL,
FENABLE VARCHAR(2) DEFAULT '2' NOT NULL,
FMSGSUBSCRIBERID BIGINT DEFAULT 0 NOT NULL,
FMSGPUBLISHERID BIGINT DEFAULT 0 NOT NULL,
FMASTERID BIGINT DEFAULT 0 NOT NULL,
FDESCRIPTION NVARCHAR(255) DEFAULT ' ' NOT NULL,
FINDEX INT DEFAULT 0 NOT NULL,
FISSYSPRESET CHAR(1) DEFAULT '0' NOT NULL,
FDISABLERID BIGINT DEFAULT 0 NOT NULL,
FDISABLEDATE DATETIME,
FCREATORID BIGINT DEFAULT 0 NOT NULL,
FMODIFIERID BIGINT DEFAULT 0 NOT NULL,
FCREATETIME DATETIME,
FMODIFYTIME DATETIME
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_HPDI_SUBAPISET_L') 
 CREATE TABLE T_HPDI_SUBAPISET_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,
FSIMPLENAME NVARCHAR(100) DEFAULT ' ' NOT NULL,
FDESCRIPTION NVARCHAR(255) DEFAULT ' ' NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_HPDI_SUBAPISETENT') 
 CREATE TABLE T_HPDI_SUBAPISETENT (
FENTRYID BIGINT DEFAULT 0 NOT NULL,
FID BIGINT DEFAULT 0 NOT NULL,
FSEQ INT DEFAULT 0 NOT NULL,
FAPIDEPLOYID BIGINT DEFAULT 0 NOT NULL,
FISCONVERTOBJECT CHAR(1) DEFAULT '0' NOT NULL,
FTARGETOBJECTID VARCHAR(50) DEFAULT ' ' NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_HPDI_SUBAPISETINDETAIL') 
 CREATE TABLE T_HPDI_SUBAPISETINDETAIL (
FDETAILID BIGINT DEFAULT 0 NOT NULL,
FENTRYID BIGINT DEFAULT 0 NOT NULL,
FSEQ INT DEFAULT 0 NOT NULL,
FFIELDNAME VARCHAR(100) DEFAULT ' ' NOT NULL,
FFIELDKEY VARCHAR(50) DEFAULT ' ' NOT NULL,
FFIELDTYPE VARCHAR(100) DEFAULT ' ' NOT NULL,
FFIELDSOURCE VARCHAR(100) DEFAULT ' ' NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_HPDI_SUBAPISETOTDETAIL') 
 CREATE TABLE T_HPDI_SUBAPISETOTDETAIL (
FDETAILID BIGINT DEFAULT 0 NOT NULL,
FENTRYID BIGINT DEFAULT 0 NOT NULL,
FSEQ INT DEFAULT 0 NOT NULL,
FAPIFIELDTYPE VARCHAR(100) DEFAULT ' ' NOT NULL,
FENTITYNAME VARCHAR(50) DEFAULT ' ' NOT NULL,
FAPIFIELDNAME VARCHAR(50) DEFAULT ' ' NOT NULL,
FAPIFIELDKEY VARCHAR(50) DEFAULT ' ' NOT NULL,
FMAPFIELDKEY VARCHAR(60) DEFAULT ' ' NOT NULL,
FMAPBASEDATAID VARCHAR(50) DEFAULT ' ' NOT NULL
);



/**End E:\NextERP_PDM\PDM_UPGRADE\PDMS\branch_lastest\pdm\HPDI_table.sql **/
