/**Begin C:\PDM_UPGRADE\PDM1\MAL_constraint.sql **/
 EXEC P_ALTERPK 'PK_T_MAL_ADDRESSREL_L', 'T_MAL_ADDRESSREL_L', 'FPKID', '1';

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


 EXEC P_ALTERPK 'PK_T_MAL_ADDRESSREL', 'T_MAL_ADDRESSREL', 'FID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_T_MAL_ADDRREL_ADDRESS') CREATE INDEX IDX_T_MAL_ADDRREL_ADDRESS ON T_MAL_ADDRESSREL ( FADDRESSID ,FEMALTYPE ,FMATCHSTATUS );


 EXEC P_ALTERPK 'PK_T_MAL_EMALADDRESS', 'T_MAL_EMALADDRESS', 'FID', '1';

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


 EXEC P_ALTERPK 'PK_T_MAL_EMALADDRESS_L', 'T_MAL_EMALADDRESS_L', 'FPKID', '1';

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


 
 EXEC P_ALTERPK 'PK_T_MAL_EMALSTATUS', 'T_MAL_EMALSTATUS', 'FID', '1';

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


 EXEC P_ALTERPK 'PK_T_MAL_EMALSTATUS_L', 'T_MAL_EMALSTATUS_L', 'FPKID', '1';

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

 
 EXEC P_ALTERPK 'PK_T_MAL_ORDER_JD', 'T_MAL_ORDER_JD', 'FID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_MAL_ORDER_JD_FORDERID') CREATE INDEX IDX_MAL_ORDER_JD_FORDERID ON T_MAL_ORDER_JD ( FORDERID );


 EXEC P_ALTERPK 'PK_T_MAL_ORDER_SN', 'T_MAL_ORDER_SN', 'FID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_MAL_ORDER_SN_FORDERID') CREATE INDEX IDX_MAL_ORDER_SN_FORDERID ON T_MAL_ORDER_SN ( FORDERID );


 EXEC P_ALTERPK 'PK_T_MAL_ORDERENTRY_JD', 'T_MAL_ORDERENTRY_JD', 'FENTRYID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_MAL_ENTRY_JD_FGOODSID') CREATE INDEX IDX_MAL_ENTRY_JD_FGOODSID ON T_MAL_ORDERENTRY_JD ( FGOODSID );

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_MAL_ENTRY_JD_FID_FSEQ') CREATE INDEX IDX_MAL_ENTRY_JD_FID_FSEQ ON T_MAL_ORDERENTRY_JD ( FID ,FENTRYID );


 EXEC P_ALTERPK 'PK_T_MAL_ORDERENTRY_SN', 'T_MAL_ORDERENTRY_SN', 'FENTRYID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_MAL_ENTRY_SN_FGOODSID') CREATE INDEX IDX_MAL_ENTRY_SN_FGOODSID ON T_MAL_ORDERENTRY_SN ( FGOODSID );

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_MAL_ENTRY_SN_FID_FSEQ') CREATE INDEX IDX_MAL_ENTRY_SN_FID_FSEQ ON T_MAL_ORDERENTRY_SN ( FID ,FENTRYID );



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