EXEC p_DropIdx 'IDX_PUR_SDCH_FERPSTATUS', 'T_PUR_SCDATACHANNEL';

IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_PUR_SDC_FISCDATASOURCEID') CREATE UNIQUE INDEX IDX_PUR_SDC_FISCDATASOURCEID ON T_PUR_SCDATACHANNEL ( FISCDATASOURCEID );

EXEC P_ALTERPK 'PK_PBD_DATACHANNELTYPE', 'T_PBD_DATACHANNELTYPE', 'FID', '1';

IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_PBD_DCT_FNUMBER') CREATE UNIQUE INDEX IDX_PBD_DCT_FNUMBER ON T_PBD_DATACHANNELTYPE ( FNUMBER );


EXEC P_ALTERPK 'PK_PUR_PBD_SERVICEDEFINE', 'T_PBD_SERVICEDEFINE', 'FID', '1';

IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_PBD_SERVICEDEFINE_FNUMBER') CREATE UNIQUE INDEX IDX_PBD_SERVICEDEFINE_FNUMBER ON T_PBD_SERVICEDEFINE ( FNUMBER );


EXEC P_ALTERPK 'PK_PBD_STRATEGYCONFIG', 'T_PBD_STRATEGYCONFIG', 'FID', '1';

IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_PBD_STRATEGYCONFIG_FNUMBER') CREATE UNIQUE INDEX IDX_PBD_STRATEGYCONFIG_FNUMBER ON T_PBD_STRATEGYCONFIG ( FNUMBER );


EXEC P_ALTERPK 'PK_PBD_EXECUTESCHEME', 'T_PBD_EXECUTESCHEME', 'FID', '1';

IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_PBD_EXECUTESCHEME_FNUMBER') CREATE UNIQUE INDEX IDX_PBD_EXECUTESCHEME_FNUMBER ON T_PBD_EXECUTESCHEME ( FNUMBER );

EXEC P_ALTERPK 'PK_PBD_EXECUTESCHEME_E', 'T_PBD_EXECUTESCHEME_E', 'FID', '1';

IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_PBD_EXECUTESCHEME_E_FTAMP') CREATE INDEX IDX_PBD_EXECUTESCHEME_E_FTAMP ON T_PBD_EXECUTESCHEME_E ( FEXECUTESTAMP );


EXEC P_ALTERPK 'PK_PBD_EXECUTEENTRY', 'T_PBD_EXECUTEENTRY', 'FENTRYID', '1';

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


EXEC P_ALTERPK 'PK_PBD_SCENEDEFINE', 'T_PBD_SCENEDEFINE', 'FID', '1';

IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_PBD_SCENEDEFINE_FNUMBER') CREATE UNIQUE INDEX IDX_PBD_SCENEDEFINE_FNUMBER ON T_PBD_SCENEDEFINE ( FNUMBER );

EXEC P_ALTERPK 'PK_PBD_MSERVICECONFIG', 'T_PBD_MSERVICECONFIG', 'FID', '1';

IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_PBD_MSERVICECONFIG_FNUMBER') CREATE UNIQUE INDEX IDX_PBD_MSERVICECONFIG_FNUMBER ON T_PBD_MSERVICECONFIG ( FNUMBER ,FBIZCLOUDID ,FBIZAPPID ,FNAME );


EXEC P_ALTERPK 'PK_PBD_JOINTSCENEPLUGIN', 'T_PBD_JOINTSCENEPLUGIN', 'FID', '1';

IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_PBD_JSPLUGIN_FNUMBER') CREATE UNIQUE INDEX IDX_PBD_JSPLUGIN_FNUMBER ON T_PBD_JOINTSCENEPLUGIN ( FNUMBER );