diff --git a/openbas-api/src/main/java/io/openbas/migration/V3_48__Adding_wrapper_functions.java b/openbas-api/src/main/java/io/openbas/migration/V3_49__Adding_wrapper_functions.java similarity index 77% rename from openbas-api/src/main/java/io/openbas/migration/V3_48__Adding_wrapper_functions.java rename to openbas-api/src/main/java/io/openbas/migration/V3_49__Adding_wrapper_functions.java index d0754ef3f5..7210df4f9f 100644 --- a/openbas-api/src/main/java/io/openbas/migration/V3_48__Adding_wrapper_functions.java +++ b/openbas-api/src/main/java/io/openbas/migration/V3_49__Adding_wrapper_functions.java @@ -7,14 +7,14 @@ import org.springframework.stereotype.Component; @Component -public class V3_48__Adding_wrapper_functions extends BaseJavaMigration { +public class V3_49__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) + CREATE OR REPLACE FUNCTION array_to_string_wrapper(a anyelement, b text) RETURNS TEXT AS $$ SELECT array_to_string(a, b) @@ -22,7 +22,7 @@ SELECT array_to_string(a, b) """); migrator.execute( """ - CREATE FUNCTION array_position_wrapper(a anyelement, b text) + CREATE OR REPLACE FUNCTION array_position_wrapper(a anyelement, b text) RETURNS INT AS $$ SELECT array_position(a, b)