migrations: fixup migration error on Postgres 10.x.
`CREATE OPERATOR` only accepts the `FUNCTION` argument since Postgres 11 or higher.
This commit is contained in:
@@ -1,7 +1,7 @@
|
|||||||
class AddReverseRegexOperator < ActiveRecord::Migration[6.1]
|
class AddReverseRegexOperator < ActiveRecord::Migration[6.1]
|
||||||
def up
|
def up
|
||||||
execute "CREATE FUNCTION reverse_textregexeq (text, text) RETURNS boolean LANGUAGE sql IMMUTABLE PARALLEL SAFE AS $$ SELECT textregexeq($2, $1); $$"
|
execute "CREATE FUNCTION reverse_textregexeq (text, text) RETURNS boolean LANGUAGE sql IMMUTABLE PARALLEL SAFE AS $$ SELECT textregexeq($2, $1); $$"
|
||||||
execute "CREATE OPERATOR ~<< (FUNCTION = reverse_textregexeq, leftarg = text, rightarg = text)"
|
execute "CREATE OPERATOR ~<< (PROCEDURE = reverse_textregexeq, leftarg = text, rightarg = text)"
|
||||||
end
|
end
|
||||||
|
|
||||||
def down
|
def down
|
||||||
|
|||||||
Reference in New Issue
Block a user