/**Begin D:\PDM_UPGRADE\PDM1\HRSS_table.sql **/
IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_HRSS_SCHOBJRELCON') 
 CREATE TABLE T_HRSS_SCHOBJRELCON (
FENTRYID BIGINT DEFAULT 0 NOT NULL,
FSEQ INT DEFAULT 0 NOT NULL,
FLEFTPROP VARCHAR(300) DEFAULT ' ' NOT NULL,
FCOMPARETYPE VARCHAR(10) DEFAULT ' ' NOT NULL,
FRIGHTPROP VARCHAR(300) DEFAULT ' ' NOT NULL,
FRIGHTPROPTYPE VARCHAR(10) DEFAULT ' ' NOT NULL,
FRIGHTPROPVAL NCLOB,
FLOGICTYPE VARCHAR(10) DEFAULT ' ' NOT NULL,
FID BIGINT DEFAULT 0 NOT NULL
);


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


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_HRSS_SCHOBJENTITY') 
 CREATE TABLE T_HRSS_SCHOBJENTITY (
FID BIGINT DEFAULT 0 NOT NULL,
FCREATORID BIGINT DEFAULT 0 NOT NULL,
FCREATETIME DATETIME,
FMODIFIERID BIGINT DEFAULT 0 NOT NULL,
FMODIFYTIME DATETIME,
FENTITYNUMBER VARCHAR(50) DEFAULT ' ' NOT NULL,
FENTITYALIAS VARCHAR(50) DEFAULT ' ' NOT NULL,
FTYPE VARCHAR(10) DEFAULT ' ' NOT NULL,
FINDEX INT DEFAULT 0 NOT NULL,
FLONGNUMBER VARCHAR(500) DEFAULT ' ' NOT NULL,
FSEARCHOBJID BIGINT DEFAULT 0 NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_HRSS_SEARCHOBJECT') 
 CREATE TABLE T_HRSS_SEARCHOBJECT (
FID BIGINT DEFAULT 0 NOT NULL,
FNUMBER VARCHAR(60) DEFAULT ' ' NOT NULL,
FNAME NVARCHAR(100) DEFAULT ' ' NOT NULL,
FSTATUS VARCHAR(2) DEFAULT ' ' NOT NULL,
FCREATORID BIGINT DEFAULT 0 NOT NULL,
FMODIFIERID BIGINT DEFAULT 0 NOT NULL,
FENABLE VARCHAR(2) DEFAULT ' ' NOT NULL,
FCREATETIME DATETIME,
FMODIFYTIME DATETIME,
FMASTERID BIGINT DEFAULT 0 NOT NULL,
FSIMPLENAME NVARCHAR(100) DEFAULT ' ' NOT NULL,
FDESCRIPTION NVARCHAR(255) DEFAULT ' ' NOT NULL,
FINDEX INT DEFAULT 0 NOT NULL,
FISSYSPRESET CHAR(1) DEFAULT ' ' NOT NULL,
FDISABLERID BIGINT DEFAULT 0 NOT NULL,
FDISABLEDATE DATETIME,
FDATAFILTER NCLOB
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_HRSS_SCHOBJRELATION') 
 CREATE TABLE T_HRSS_SCHOBJRELATION (
FID BIGINT DEFAULT 0 NOT NULL,
FCREATORID BIGINT DEFAULT 0 NOT NULL,
FCREATETIME DATETIME,
FMODIFIERID BIGINT DEFAULT 0 NOT NULL,
FMODIFYTIME DATETIME,
FENTITYID BIGINT DEFAULT 0 NOT NULL,
FJOINTYPE VARCHAR(10) DEFAULT ' ' NOT NULL,
FJOINENTITYID BIGINT DEFAULT 0 NOT NULL,
FSEARCHOBJID BIGINT DEFAULT 0 NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_HRSS_SEARCHOBJECT_L') 
 CREATE TABLE T_HRSS_SEARCHOBJECT_L (
FID BIGINT DEFAULT 0 NOT NULL,
FLOCALEID VARCHAR(10) DEFAULT ' ' NOT NULL,
FPKID VARCHAR(18) 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_HRSS_SCHOBJFIELD') 
 CREATE TABLE T_HRSS_SCHOBJFIELD (
FID BIGINT DEFAULT 0 NOT NULL,
FCREATORID BIGINT DEFAULT 0 NOT NULL,
FCREATETIME DATETIME,
FMODIFIERID BIGINT DEFAULT 0 NOT NULL,
FMODIFYTIME DATETIME,
FENTITYNUMBER VARCHAR(50) DEFAULT ' ' NOT NULL,
FFIELDNAME NVARCHAR(50) DEFAULT ' ' NOT NULL,
FFIELDALIAS VARCHAR(300) DEFAULT ' ' NOT NULL,
FFIELDPATH VARCHAR(300) DEFAULT ' ' NOT NULL,
FVALUETYPE VARCHAR(20) DEFAULT ' ' NOT NULL,
FCOMPLEXTYPE VARCHAR(10) DEFAULT ' ' NOT NULL,
FSEARCHOBJID BIGINT DEFAULT 0 NOT NULL
);



/**End D:\PDM_UPGRADE\PDM1\HRSS_table.sql **/
