/**Begin C:\PDM_UPGRADE\PDM1\BASE_constraint.sql **/
 EXEC P_ALTERPK 'PK_T_BD_SUPPLIERGRADE', 'T_BD_SUPPLIERGRADE', 'FID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_BD_SUPGRADE_ORG_SUP_CAT') CREATE INDEX IDX_BD_SUPGRADE_ORG_SUP_CAT ON T_BD_SUPPLIERGRADE ( FCREATEORGID ,FCATEGORYID ,FBDSUPPLIERID );

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


 EXEC P_ALTERPK 'PK_T_BD_SUPGRADEENTER', 'T_BD_SUPGRADEENTER', 'FID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_BD_SUPGRADE_ENTER_FBILLNO') CREATE INDEX IDX_BD_SUPGRADE_ENTER_FBILLNO ON T_BD_SUPGRADEENTER ( FBILLNO );


 EXEC P_ALTERPK 'PK_T_BD_EVAGRADE_L', 'T_BD_EVAGRADE_L', 'FPKID', '1';

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


 EXEC P_ALTERPK 'PK_T_BD_EVAGRADE', 'T_BD_EVAGRADE', 'FID', '1';

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


 EXEC P_ALTERPK 'PK_T_BD_SUPGRADEENTRY', 'T_BD_SUPGRADEENTRY', 'FENTRYID', '1';

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


 EXEC P_ALTERPK 'PK_T_BD_SUPPLIERGRADE_L', 'T_BD_SUPPLIERGRADE_L', 'FPKID', '1';

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



/**End C:\PDM_UPGRADE\PDM1\BASE_constraint.sql **/
