-
Notifications
You must be signed in to change notification settings - Fork 90
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[backend] Add new indexes on join (#1184)
- Loading branch information
1 parent
5d40676
commit f108f24
Showing
1 changed file
with
22 additions
and
0 deletions.
There are no files selected for viewing
22 changes: 22 additions & 0 deletions
22
openbas-api/src/main/java/io/openbas/migration/V3_33_ADD_Index_inject.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
package io.openbas.migration; | ||
|
||
import org.flywaydb.core.api.migration.BaseJavaMigration; | ||
import org.flywaydb.core.api.migration.Context; | ||
import org.springframework.stereotype.Component; | ||
|
||
import java.sql.Statement; | ||
|
||
@Component | ||
public class V3_33__Add_index extends BaseJavaMigration { | ||
|
||
@Override | ||
public void migrate(Context context) throws Exception { | ||
Statement select = context.getConnection().createStatement(); | ||
select.execute("" | ||
+ "CREATE INDEX idx_inject_inject_injector_contract on injects (inject_injector_contract);" | ||
+ "CREATE INDEX idx_injector_contract_injector on injectors_contracts (injector_id);" | ||
+ "CREATE INDEX idx_injector_inject on injectors (injector_id);" | ||
+ "" | ||
); | ||
} | ||
} |