Closed bekicot closed 2 years ago
create_function :naturalsort, sql_definition: <<-SQL CREATE OR REPLACE FUNCTION public.naturalsort(text) RETURNS bytea LANGUAGE sql IMMUTABLE STRICT AS $function$ select string_agg(convert_to(coalesce(r[2], length(length(r[1])::text) || length(r[1])::text || r[1]), 'SQL_ASCII'),'\x00') from regexp_matches($1, '0*([0-9]+)|([^0-9]+)', 'g') r; $function$ SQL
notice the \x00 I think it should be escaped in the generated schema.rb.
\x00
It works if we use structure.sql .
Looks like it is fixed in here: https://github.com/teoljungberg/fx/commit/a9c262836c02dabced6c18172f022df2efff6b5b
Thanks for the bug report, point the gem towards master and I'll cut a new release soon.
notice the
\x00
I think it should be escaped in the generated schema.rb.It works if we use structure.sql .