EXEC p_DropIdx 'IDX_FA_STOREKEEPER', 'T_FA_STOREKEEPER';
IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_TABNAME = 'T_FA_STOREKEEPER' AND KSQL_INDNAME = 'IDX_FA_STOREKEEPER')
CREATE INDEX IDX_FA_STOREKEEPER ON T_FA_STOREKEEPER (FORGID ,FROLE );

EXEC p_AlterPK 'PK_FA_ORGMANAGERS', 'T_FA_ORGMANAGERS', 'FPKID', '1';
IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_TABNAME = 'T_FA_ORGMANAGERS' AND KSQL_INDNAME = 'IDX_FA_ORGMANAGERS_FK')
CREATE INDEX IDX_FA_ORGMANAGERS_FK ON T_FA_ORGMANAGERS (FID );


EXEC p_AlterPK 'PK_FA_ASSETMANAGER_ENTRY', 'T_FA_ASSETMANAGER_ENTRY', 'FENTRYID', '1';
IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_TABNAME = 'T_FA_ASSETMANAGER_ENTRY' AND KSQL_INDNAME = 'IDX_FA_ASSETMANAGER_FK')
CREATE INDEX IDX_FA_ASSETMANAGER_FK ON T_FA_ASSETMANAGER_ENTRY (FID );


EXEC p_AlterPK 'PK_FA_MANAGE_ASSETCAT', 'T_FA_MANAGE_ASSETCAT', 'FPKID', '1';
IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_TABNAME = 'T_FA_MANAGE_ASSETCAT' AND KSQL_INDNAME = 'IDX_FA_MANAGE_ASSETCAT_FK')
CREATE INDEX IDX_FA_MANAGE_ASSETCAT_FK ON T_FA_MANAGE_ASSETCAT (FENTRYID );


EXEC p_AlterPK 'PK_FA_MANAGE_USEDEPT', 'T_FA_MANAGE_USEDEPT', 'FPKID', '1';
IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_TABNAME = 'T_FA_MANAGE_USEDEPT' AND KSQL_INDNAME = 'IDX_FA_MANAGE_USEDEPT_FK')
CREATE INDEX IDX_FA_MANAGE_USEDEPT_FK ON T_FA_MANAGE_USEDEPT (FENTRYID );


EXEC p_AlterPK 'PK_FA_MANAGE_MGTDEPT', 'T_FA_MANAGE_MGTDEPT', 'FPKID', '1';
IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_TABNAME = 'T_FA_MANAGE_MGTDEPT' AND KSQL_INDNAME = 'IDX_FA_MANAGE_MGTDEPT_FK')
CREATE INDEX IDX_FA_MANAGE_MGTDEPT_FK ON T_FA_MANAGE_MGTDEPT (FENTRYID );


EXEC p_AlterPK 'PK_FA_WARN_SETTING', 'T_FA_WARN_SETTING', 'FID', '1';
EXEC p_AlterPK 'PK_FA_WARNENTRY', 'T_FA_WARNENTRY', 'FENTRYID', '1';
IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_TABNAME = 'T_FA_WARNENTRY' AND KSQL_INDNAME = 'IDX_FA_WARNENTRY_FK')
CREATE INDEX IDX_FA_WARNENTRY_FK ON T_FA_WARNENTRY (FID );
IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_TABNAME = 'T_FA_WARN_SETTING' AND KSQL_INDNAME = 'IDX_FA_WARN_SETTING_ORG')
CREATE INDEX IDX_FA_WARN_SETTING_ORG ON T_FA_WARN_SETTING (FORGID );
