EXEC P_ALTERPK 'PK_FMM_WORKINGGROUP', 'T_FMM_WORKINGGROUP', 'FID', '1';
 
IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_FMM_WORKINGGROUP_FNUM') CREATE INDEX IDX_FMM_WORKINGGROUP_FNUM ON T_FMM_WORKINGGROUP (FNUMBER);

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


EXEC P_ALTERPK 'PK_FMM_WORKINGGROUP_L', 'T_FMM_WORKINGGROUP_L', 'FPKID', '1';

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

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


EXEC P_ALTERPK 'PK_FMM_WKGROUPROLEMSG', 'T_FMM_WKGROUPROLEMSG', 'FENTRYID', '1';
 
IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_FMM_WKGROUPROLEMSG_FSEQ') CREATE INDEX IDX_FMM_WKGROUPROLEMSG_FSEQ ON T_FMM_WKGROUPROLEMSG (FID,FSEQ);


EXEC P_ALTERPK 'PK_FMM_WKGPDISPATCHMSG', 'T_FMM_WKGPDISPATCHMSG', 'FENTRYID', '1';
 
IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_FMM_WKGPDISPATCHMSG_FSEQ') CREATE INDEX IDX_FMM_WKGPDISPATCHMSG_FSEQ ON T_FMM_WKGPDISPATCHMSG (FID,FSEQ);