/**Begin E:\PDM\PDM1\BOS_table.sql **/
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_INT_PUBLICHOLIDAY' AND KSQL_COL_NAME ='FHOLIDAYCLASS')
 ALTER TABLE T_INT_PUBLICHOLIDAY ADD (FHOLIDAYCLASS BIGINT DEFAULT 0 NOT NULL );

-- 创建 表 --
IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_INT_HOLIDAYCLASS') 
 CREATE TABLE T_INT_HOLIDAYCLASS (
FID BIGINT DEFAULT 0 NOT NULL,
FMASTERID BIGINT DEFAULT 0 NOT NULL,
FNUMBER VARCHAR(30) DEFAULT ' ' NOT NULL,
FNAME VARCHAR(50) DEFAULT ' ' NOT NULL,
FSTATUS VARCHAR(50) DEFAULT ' ' NOT NULL,
FENABLE VARCHAR(50) DEFAULT ' ' NOT NULL,
FCREATORID BIGINT DEFAULT 0 NOT NULL,
FCREATETIME DATETIME,
FMODIFIERID BIGINT DEFAULT 0 NOT NULL,
FMODIFYTIME DATETIME,
FCOUNTRY BIGINT DEFAULT 0 NOT NULL,
FISSYSTEM CHAR(1) DEFAULT '0' NOT NULL
);



IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_INT_HOLIDAYCLASS_L') 
 CREATE TABLE T_INT_HOLIDAYCLASS_L (
FPKID VARCHAR(32) DEFAULT ' ' NOT NULL,
FID BIGINT DEFAULT 0 NOT NULL,
FLOCALEID VARCHAR(10) DEFAULT ' ' NOT NULL,
FNAME VARCHAR(64) DEFAULT ' ' NOT NULL
);

-- 添加索引 --
EXEC P_ALTERPK 'PK_T_INT_HOLIDAYCLASS', 'T_INT_HOLIDAYCLASS', 'FID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_T_INT_HOLIDAYCLASS_FNUM') CREATE INDEX IDX_T_INT_HOLIDAYCLASS_FNUM ON T_INT_HOLIDAYCLASS ( FNUMBER );


 EXEC P_ALTERPK 'PK_T_INT_HOLIDAYCLASS_L', 'T_INT_HOLIDAYCLASS_L', 'FPKID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_T_INT_HOLIDAYCLASS_FID') CREATE INDEX IDX_T_INT_HOLIDAYCLASS_FID ON T_INT_HOLIDAYCLASS_L ( FID );



/**End E:\PDM\PDM1\BOS_table.sql **/
