-
Notifications
You must be signed in to change notification settings - Fork 86
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[backend] Upgrading to latest spring boot version
- Loading branch information
Showing
3 changed files
with
39 additions
and
2 deletions.
There are no files selected for viewing
32 changes: 32 additions & 0 deletions
32
openbas-api/src/main/java/io/openbas/migration/V3_48__Adding_wrapper_functions.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,32 @@ | ||
package io.openbas.migration; | ||
|
||
import java.sql.SQLException; | ||
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_48__Adding_wrapper_functions extends BaseJavaMigration { | ||
|
||
@Override | ||
public void migrate(Context context) throws SQLException { | ||
Statement migrator = context.getConnection().createStatement(); | ||
migrator.execute( | ||
""" | ||
CREATE FUNCTION array_to_string_wrapper(a anyelement, b text) | ||
RETURNS TEXT AS | ||
$$ | ||
SELECT array_to_string(a, b) | ||
$$ LANGUAGE SQL; | ||
"""); | ||
migrator.execute( | ||
""" | ||
CREATE FUNCTION array_position_wrapper(a anyelement, b text) | ||
RETURNS INT AS | ||
$$ | ||
SELECT array_position(a, b) | ||
$$ LANGUAGE SQL; | ||
"""); | ||
} | ||
} |
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
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