/**Begin D:\tool\PDM_UPGRADE_1.3\PDM_UPGRADE\pdm1\BASE_constraint.sql **/
 EXEC P_ALTERPK 'PK_T_BD_INVOICEBIZ', 'T_BD_INVOICEBIZ', 'FID', '1';

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


 EXEC P_ALTERPK 'PK_T_BD_INVOICEBIZ_L', 'T_BD_INVOICEBIZ_L', 'FPKID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_BD_INVOICEBIZ_L_ID') CREATE INDEX IDX_BD_INVOICEBIZ_L_ID ON T_BD_INVOICEBIZ_L ( FID ,FLOCALEID );


 EXEC P_ALTERPK 'PK_T_BD_INVOICEBIZ_TYPE', 'T_BD_INVOICEBIZ_TYPE', 'FPKID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_BD_INVOICEBIZ_TYPE_BDID') CREATE INDEX IDX_BD_INVOICEBIZ_TYPE_BDID ON T_BD_INVOICEBIZ_TYPE ( FBASEDATAID );

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


 EXEC P_ALTERPK 'PK_T_BD_INVOICEBIZ_BIZ', 'T_BD_INVOICEBIZ_BIZ', 'FPKID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_BD_INVOICEBIZ_BIZ_BDID') CREATE INDEX IDX_BD_INVOICEBIZ_BIZ_BDID ON T_BD_INVOICEBIZ_BIZ ( FBASEDATAID );

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



/**End D:\tool\PDM_UPGRADE_1.3\PDM_UPGRADE\pdm1\BASE_constraint.sql **/
