/**Begin D:\PDM_UPGRADE\PDM1\FPM_table.sql **/
IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_FPM_SUMMARYCONFIG_SNP') 
 CREATE TABLE T_FPM_SUMMARYCONFIG_SNP (
FID BIGINT DEFAULT 0 NOT NULL,
FNUMBER VARCHAR(50) DEFAULT ' ' NOT NULL,
FDISABLERID BIGINT DEFAULT 0 NOT NULL,
FENABLERID BIGINT DEFAULT 0 NOT NULL,
FENABLEDATE DATETIME,
FDISABLEDATE DATETIME,
FBODYSYSID BIGINT DEFAULT 0 NOT NULL,
FSUMREPULSESTATUS VARCHAR(50) DEFAULT ' ' NOT NULL,
FNAME VARCHAR(50) DEFAULT ' ' NOT NULL,
FSTATUS VARCHAR(50) DEFAULT ' ' NOT NULL,
FCREATORID BIGINT DEFAULT 0 NOT NULL,
FMODIFIERID BIGINT DEFAULT 0 NOT NULL,
FENABLE CHAR(1) DEFAULT ' ' NOT NULL,
FCREATETIME DATETIME,
FMODIFYTIME DATETIME,
FMASTERID BIGINT DEFAULT 0 NOT NULL,
FSUMMARYCONFIGID BIGINT DEFAULT 0 NOT NULL,
FTREEENTRYENTITYMD5 VARCHAR(32) DEFAULT ' ' NOT NULL
);


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


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_FPM_SUMMAINPARAM_SNP') 
 CREATE TABLE T_FPM_SUMMAINPARAM_SNP (
FID BIGINT DEFAULT 0 NOT NULL,
FENTRYID BIGINT DEFAULT 0 NOT NULL,
FSEQ INT DEFAULT 0 NOT NULL,
FPARENTENTRYID BIGINT DEFAULT 0 NOT NULL,
FREPORTORGID BIGINT DEFAULT 0 NOT NULL,
FPARENTID BIGINT DEFAULT 0 NOT NULL,
FLEVEL INT DEFAULT 0 NOT NULL,
FISSUMAUDIT CHAR(1) DEFAULT ' ' NOT NULL,
FISCHECKSUBLIMIT VARCHAR(50) DEFAULT ' ' NOT NULL,
FCURRENCYMAPCASE VARCHAR(125) DEFAULT ' ' NOT NULL,
FCURRENCYMAPCASEREAL NVARCHAR(255) DEFAULT ' ' NOT NULL,
FCURRENCYMAPCASEREAL_TAG NCLOB
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_FPM_REPORT' AND KSQL_COL_NAME IN ('FSUMMARYCONFIGSNPID')) 
 ALTER TABLE T_FPM_REPORT ADD (FSUMMARYCONFIGSNPID BIGINT DEFAULT 0 NOT NULL );

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