/**Begin E:\NextERP_PDM\PDM_UPGRADE\PDMS\branch_lastest\pdm\SYSEXT_table.sql **/
IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_KF_INSTANCE') 
 CREATE TABLE T_KF_INSTANCE (
FID BIGINT DEFAULT 0 NOT NULL,
FNUMBER VARCHAR(50) DEFAULT ' ' NOT NULL,
FNAME NVARCHAR(50) DEFAULT ' ' NOT NULL,
FDESC NVARCHAR(200) DEFAULT ' ' NOT NULL,
FGROUPID BIGINT DEFAULT 0 NOT NULL,
FDATA NCLOB,
FISV VARCHAR(50) DEFAULT ' ' NOT NULL,
FVERSION INT DEFAULT 0 NOT NULL,
FAPPID VARCHAR(36) DEFAULT ' ' NOT NULL,
FENABLED CHAR(1) DEFAULT '1' NOT NULL,
FCREATORID BIGINT DEFAULT 0 NOT NULL,
FCREATEDATE DATETIME DEFAULT GETDATE() NOT NULL,
FMODIFIERID BIGINT DEFAULT 0 NOT NULL,
FMODIFYDATE DATETIME
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_KF_INSTANCE_L') 
 CREATE TABLE T_KF_INSTANCE_L (
FPKID VARCHAR(36) DEFAULT ' ' NOT NULL,
FID BIGINT DEFAULT 0 NOT NULL,
FLOCALEID VARCHAR(10) DEFAULT ' ' NOT NULL,
FNAME NVARCHAR(50) DEFAULT ' ' NOT NULL,
FDESC NVARCHAR(200) DEFAULT ' ' NOT NULL,
FDATA NCLOB
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_KF_REFRENCE_L') 
 CREATE TABLE T_KF_REFRENCE_L (
FPKID VARCHAR(36) DEFAULT ' ' NOT NULL,
FID BIGINT DEFAULT 0 NOT NULL,
FLOCALEID VARCHAR(10) DEFAULT ' ' NOT NULL,
FDESC NVARCHAR(200) DEFAULT ' ' NOT NULL,
FDATA NCLOB
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_KF_INSTANCEGROUP') 
 CREATE TABLE T_KF_INSTANCEGROUP (
FID BIGINT DEFAULT 0 NOT NULL,
FNUMBER VARCHAR(50) DEFAULT ' ' NOT NULL,
FNAME NVARCHAR(50) DEFAULT ' ' NOT NULL,
FENABLED CHAR(1) DEFAULT '1' NOT NULL
);


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


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_KF_REFERENCE') 
 CREATE TABLE T_KF_REFERENCE (
FID BIGINT DEFAULT 0 NOT NULL,
FAPPID VARCHAR(36) DEFAULT ' ' NOT NULL,
FKFID BIGINT DEFAULT 0 NOT NULL,
FRESOURCEID VARCHAR(50) DEFAULT ' ' NOT NULL,
FSCENE VARCHAR(36) DEFAULT ' ' NOT NULL,
FDESC NVARCHAR(200) DEFAULT ' ' NOT NULL,
FDATA NCLOB,
FEVENT VARCHAR(50) DEFAULT ' ' NOT NULL,
FTRIGGERTIME VARCHAR(50) DEFAULT ' ' NOT NULL,
FENABLED CHAR(1) DEFAULT '1' NOT NULL,
FCREATORID BIGINT DEFAULT 0 NOT NULL,
FCREATEDATE DATETIME DEFAULT GETDATE() NOT NULL,
FMODIFIERID BIGINT DEFAULT 0 NOT NULL,
FMODIFYDATE DATETIME
);



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