/**Begin D:\PDM_UPGRADE\PDM1\HOM_table.sql **/
IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_HOM_COLLECTLOG')
 CREATE TABLE T_HOM_COLLECTLOG (
FID BIGINT DEFAULT 0 NOT NULL,
FAPPROVEID BIGINT DEFAULT 0 NOT NULL,
FAPPROVETIME DATETIME,
FOPERATETYPE VARCHAR(2) DEFAULT ' ' NOT NULL,
FREMARK NVARCHAR(255) DEFAULT ' ' NOT NULL,
FCOLLECTACTIVITYID BIGINT DEFAULT 0 NOT NULL
);


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


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_HOM_COLLECTLOGENTITY')
 CREATE TABLE T_HOM_COLLECTLOGENTITY (
FENTRYID BIGINT DEFAULT 0 NOT NULL,
FID BIGINT DEFAULT 0 NOT NULL,
FSEQ INT DEFAULT 0 NOT NULL,
FINFOGROUPID BIGINT DEFAULT 0 NOT NULL,
FINFOGROUPNAME NVARCHAR(50) DEFAULT ' ' NOT NULL,
FMULITITLE NVARCHAR(50) DEFAULT ' ' NOT NULL
);


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


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_HOM_COLLECTLOGSUB')
 CREATE TABLE T_HOM_COLLECTLOGSUB (
FDETAILID BIGINT DEFAULT 0 NOT NULL,
FENTRYID BIGINT DEFAULT 0 NOT NULL,
FSEQ INT DEFAULT 0 NOT NULL,
FINFOGROUPFIELDID BIGINT DEFAULT 0 NOT NULL,
FENTRYFIELD NVARCHAR(50) DEFAULT ' ' NOT NULL,
FENTRYREMARK NVARCHAR(255) DEFAULT ' ' NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_HOM_COLLECTLOGSUB_L')
 CREATE TABLE T_HOM_COLLECTLOGSUB_L (
FPKID VARCHAR(36) DEFAULT ' ' NOT NULL,
FDETAILID BIGINT DEFAULT 0 NOT NULL,
FLOCALEID VARCHAR(10) DEFAULT ' ' NOT NULL,
FENTRYFIELD NVARCHAR(50) DEFAULT ' ' NOT NULL,
FENTRYREMARK NVARCHAR(255) DEFAULT ' ' NOT NULL
);



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