/**Begin D:\softwaresetup\PDM_UPGRADE\PDM1\FPM_table.sql **/
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_FPM_BODYSYSMANAGE' AND KSQL_COL_NAME IN ('FCREATORMANAGE'))
 ALTER TABLE T_FPM_BODYSYSMANAGE ADD (FCREATORMANAGE BIGINT DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_FPM_MEMBER_E' AND KSQL_COL_NAME IN ('FREPORTTYPE'))
 ALTER TABLE T_FPM_MEMBER_E ADD (FREPORTTYPE VARCHAR(100) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_FPM_MEMBER_E' AND KSQL_COL_NAME IN ('FSTARTDATE'))
 ALTER TABLE T_FPM_MEMBER_E ADD (FSTARTDATE DATETIME );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_FPM_MEMBER_E' AND KSQL_COL_NAME IN ('FENDDATE'))
 ALTER TABLE T_FPM_MEMBER_E ADD (FENDDATE DATETIME );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_FPM_MEMBER_E' AND KSQL_COL_NAME IN ('FDECLARESTATUS'))
 ALTER TABLE T_FPM_MEMBER_E ADD (FDECLARESTATUS VARCHAR(50) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_FPM_MEMBER_E' AND KSQL_COL_NAME IN ('FYEAR'))
 ALTER TABLE T_FPM_MEMBER_E ADD (FYEAR INT DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_FPM_MEMBER_E' AND KSQL_COL_NAME IN ('FISSUM'))
 ALTER TABLE T_FPM_MEMBER_E ADD (FISSUM CHAR(1) DEFAULT '0' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_FPM_MEMBER_E' AND KSQL_COL_NAME IN ('FCURRENCYID'))
 ALTER TABLE T_FPM_MEMBER_E ADD (FCURRENCYID BIGINT DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_FPM_BODYSYSMANAGE_UG')
 CREATE TABLE T_FPM_BODYSYSMANAGE_UG (
FPKID BIGINT DEFAULT 0 NOT NULL,
FID BIGINT DEFAULT 0 NOT NULL,
FBASEDATAID BIGINT DEFAULT 0 NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_FPM_BODYSYSMANAGE_USER')
 CREATE TABLE T_FPM_BODYSYSMANAGE_USER (
FPKID BIGINT DEFAULT 0 NOT NULL,
FID BIGINT DEFAULT 0 NOT NULL,
FBASEDATAID BIGINT DEFAULT 0 NOT NULL
);



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