/**Begin D:\PDM_UPGRADE\pdmnew\BASE_table.sql **/
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_BD_PROJECTSTATUS' AND KSQL_COL_NAME ='FPROJECTKINDID')
 ALTER TABLE T_BD_PROJECTSTATUS ADD (FPROJECTKINDID BIGINT DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_BD_PROSTATUS_PERM')
 CREATE TABLE T_BD_PROSTATUS_PERM (
FID BIGINT DEFAULT 0 NOT NULL,
FNUMBER 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 VARCHAR(50) DEFAULT ' ' NOT NULL,
FCREATETIME DATETIME,
FMODIFYTIME DATETIME,
FMASTERID BIGINT DEFAULT 0 NOT NULL,
FREMARK VARCHAR(255) DEFAULT ' ' NOT NULL,
FPROJECTSTATUSID BIGINT DEFAULT 0 NOT NULL,
FPROJECTKINDID BIGINT DEFAULT 0 NOT NULL
);


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


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_BD_STATUSENTRY')
 CREATE TABLE T_BD_STATUSENTRY (
FID BIGINT DEFAULT 0 NOT NULL,
FENTRYID BIGINT DEFAULT 0 NOT NULL,
FSEQ INT DEFAULT 0 NOT NULL,
FCTRLTARGET VARCHAR(50) DEFAULT ' ' NOT NULL,
FENTITYOBJECTID VARCHAR(50) DEFAULT ' ' NOT NULL
);



/**End D:\PDM_UPGRADE\pdmnew\BASE_table.sql **/
