/**Begin E:\NextERP_PDM\PDM_UPGRADE\PDMS\branch_lastest\pdm\BOS_table.sql **/
IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_INT_COUNTRYCONFIG') 
 CREATE TABLE T_INT_COUNTRYCONFIG (
FID BIGINT DEFAULT 0 NOT NULL,
FCREATORID BIGINT DEFAULT 0 NOT NULL,
FCREATETIME DATETIME,
FMODIFIERID BIGINT DEFAULT 0 NOT NULL,
FMODIFYTIME DATETIME,
FDISABLERID BIGINT DEFAULT 0 NOT NULL,
FDISABLEDATE DATETIME
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_INT_COUNTRYCONFIGENTRY') 
 CREATE TABLE T_INT_COUNTRYCONFIGENTRY (
FID BIGINT DEFAULT 0 NOT NULL,
FENTRYID BIGINT DEFAULT 0 NOT NULL,
FSEQ INT DEFAULT 0 NOT NULL,
FCOUNTRY BIGINT DEFAULT 0 NOT NULL,
FLANGUAGE BIGINT DEFAULT 0 NOT NULL,
FCURRENCY BIGINT DEFAULT 0 NOT NULL,
FTIMEZONE BIGINT DEFAULT 0 NOT NULL,
FREGIONALFORMAT BIGINT DEFAULT 0 NOT NULL
);

 EXEC P_ALTERPK 'PK_T_INT_COUNTRYCONFIG', 'T_INT_COUNTRYCONFIG', 'FID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_INT_CCONF_CREATETIME') CREATE INDEX IDX_INT_CCONF_CREATETIME ON T_INT_COUNTRYCONFIG (FCREATETIME);

 EXEC P_ALTERPK 'PK_T_INT_COUNTRYCONFIGENTRY', 'T_INT_COUNTRYCONFIGENTRY', 'FENTRYID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_T_INT_CC_FENTRY') CREATE INDEX IDX_T_INT_CC_FENTRY ON T_INT_COUNTRYCONFIGENTRY (FCOUNTRY);
