/**Begin D:\ProgramFiles\PDM_UPGRADE\pdm1\FMM_constraint.sql **/
 EXEC P_ALTERPK 'PK_FMM_SEAL', 'T_FMM_SEAL', 'FID', '1';

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

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


 EXEC P_ALTERPK 'PK_FMM_SEAL_L', 'T_FMM_SEAL_L', 'FPKID', '1';

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

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_FMM_SEALL_FNAME') CREATE INDEX IDX_FMM_SEALL_FNAME ON T_FMM_SEAL_L ( FNAME );


 EXEC P_ALTERPK 'PK_FMM_SEAL_TYPE', 'T_FMM_SEAL_TYPE', 'FID', '1';

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

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


 EXEC P_ALTERPK 'PK_FMM_SEAL_TYPE_L', 'T_FMM_SEAL_TYPE_L', 'FPKID', '1';

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

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_FMM_SEALL_TYPE_FNAME') CREATE INDEX IDX_FMM_SEALL_TYPE_FNAME ON T_FMM_SEAL_TYPE_L ( FNAME );


 EXEC P_ALTERPK 'PK_FMM_SEALAP_TYPE', 'T_FMM_SEALAP_TYPE', 'FID', '1';

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

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


 EXEC P_ALTERPK 'PK_FMM_SEALAP_TYPE_L', 'T_FMM_SEALAP_TYPE_L', 'FPKID', '1';

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

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_FMM_SEALAPL_FNAME') CREATE INDEX IDX_FMM_SEALAPL_FNAME ON T_FMM_SEALAP_TYPE_L ( FNAME );


 EXEC P_ALTERPK 'PK_FMM_REPAIRE_TYPE_L', 'T_FMM_REPAIRE_TYPE_L', 'FPKID', '1';

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

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_FMM_REPAREL_FNAME') CREATE INDEX IDX_FMM_REPAREL_FNAME ON T_FMM_REPAIRE_TYPE_L ( FNAME );


 EXEC P_ALTERPK 'PK_FMM_REPAIRE_TYPE', 'T_FMM_REPAIRE_TYPE', 'FID', '1';

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

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



/**End D:\ProgramFiles\PDM_UPGRADE\pdm1\FMM_constraint.sql **/
