/**Begin D:\softwaresetup\PDM_UPGRADE\PDM1\FPM_table.sql **/
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_FPM_TEMPLATE_DIMSET' AND KSQL_COL_NAME IN ('FDIMBDTYPE')) 
 ALTER TABLE T_FPM_TEMPLATE_DIMSET ADD (FDIMBDTYPE VARCHAR(50) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_FPM_TEMPLATE_DIMSET' AND KSQL_COL_NAME IN ('FDIMBDID')) 
 ALTER TABLE T_FPM_TEMPLATE_DIMSET ADD (FDIMBDID BIGINT DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_FPM_DETAILPLANFIELDS') 
 CREATE TABLE T_FPM_DETAILPLANFIELDS (
FID BIGINT DEFAULT 0 NOT NULL,
FNUMBER 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 '1' NOT NULL,
FCREATETIME DATETIME,
FMODIFYTIME DATETIME,
FMASTERID BIGINT DEFAULT 0 NOT NULL,
FDISABLERID BIGINT DEFAULT 0 NOT NULL,
FENABLERID BIGINT DEFAULT 0 NOT NULL,
FENABLEDATE DATETIME,
FDISABLEDATE DATETIME,
FBODYSYS BIGINT DEFAULT 0 NOT NULL,
FCOMMENT VARCHAR(255) DEFAULT ' ' NOT NULL,
FDETAILDIMTYPE VARCHAR(50) DEFAULT ' ' NOT NULL,
FFIELDNAME VARCHAR(50) DEFAULT ' ' NOT NULL,
FSYSSETPRE CHAR(1) DEFAULT '0' NOT NULL,
FDATATYPE VARCHAR(50) DEFAULT ' ' NOT NULL,
FOPTION VARCHAR(255) DEFAULT ' ' NOT NULL,
FISSHOW CHAR(1) DEFAULT '0' NOT NULL,
FISMUSTINPUT CHAR(1) DEFAULT '0' NOT NULL,
FSORT INT DEFAULT 0 NOT NULL
);


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



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