/**Begin D:\PDM_UPGRADE\PDM1\HRCS_table.sql **/

IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_HBSS_PERMROLE' AND KSQL_COL_NAME IN ('FCREATEADMINGRP')) 
 ALTER TABLE T_HBSS_PERMROLE ADD (FCREATEADMINGRP BIGINT DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_HBSS_PERMROLE' AND KSQL_COL_NAME IN ('FUSESCOPE')) 
 ALTER TABLE T_HBSS_PERMROLE ADD (FUSESCOPE CHAR(1) DEFAULT '2' NOT NULL );
 
IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_HRCS_ROLEASSIGNSCOPE') 
 CREATE TABLE T_HRCS_ROLEASSIGNSCOPE (
FID BIGINT DEFAULT 0 NOT NULL,
FADMINGROUPID BIGINT DEFAULT 0 NOT NULL,
FROLEID VARCHAR(18) DEFAULT ' ' NOT NULL,
FISMODIFIABLE CHAR(1) DEFAULT '0' NOT NULL,
FCREATORID BIGINT DEFAULT 0 NOT NULL,
FCREATETIME DATETIME,
FMODIFIERID BIGINT DEFAULT 0 NOT NULL,
FMODIFYTIME DATETIME
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_HRCS_ROLEOPENSCOPE') 
 CREATE TABLE T_HRCS_ROLEOPENSCOPE (
FID BIGINT DEFAULT 0 NOT NULL,
FADMINGROUPID BIGINT DEFAULT 0 NOT NULL,
FROLEID VARCHAR(18) DEFAULT ' ' NOT NULL,
FCREATORID BIGINT DEFAULT 0 NOT NULL,
FCREATETIME DATETIME,
FMODIFIERID BIGINT DEFAULT 0 NOT NULL,
FMODIFYTIME DATETIME
);

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