-
Notifications
You must be signed in to change notification settings - Fork 87
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[backend] Fix on deleting a type representation deletes injector cont…
…ract (#2203)
- Loading branch information
Showing
2 changed files
with
25 additions
and
1 deletion.
There are no files selected for viewing
24 changes: 24 additions & 0 deletions
24
openbas-api/src/main/java/io/openbas/migration/V3_54__Alter_xls_mapper_table.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,24 @@ | ||
package io.openbas.migration; | ||
|
||
import java.sql.Connection; | ||
import java.sql.Statement; | ||
import org.flywaydb.core.api.migration.BaseJavaMigration; | ||
import org.flywaydb.core.api.migration.Context; | ||
import org.springframework.stereotype.Component; | ||
|
||
@Component | ||
public class V3_54__Alter_xls_mapper_table extends BaseJavaMigration { | ||
|
||
@Override | ||
public void migrate(Context context) throws Exception { | ||
Connection connection = context.getConnection(); | ||
Statement statement = connection.createStatement(); | ||
|
||
statement.execute( | ||
"ALTER TABLE inject_importers alter column importer_mapper_id drop not null;"); | ||
statement.execute( | ||
"ALTER TABLE inject_importers alter column importer_injector_contract_id drop not null;"); | ||
statement.execute( | ||
"ALTER TABLE rule_attributes alter column attribute_inject_importer_id drop not null;"); | ||
} | ||
} |
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