On Tue, Mar 30, 2021 at 6:22 AM Robert Pawlas <[email protected]> wrote:

> Hello!
>
> I found problem during dumping schema with
>
> DB.dump_schema_migration(same_db: true)
>
> The problem is indexes that include Sequel function as first parameter,
> are not being dumped.
>
> Here's sample index in create_table migration:
>
> Sequel.migration do
>   change do
>     create_table(:tests) do
>        index Sequel.function(:lower, :name),
>        name: :tests_unique_name_index,
>         unique: true
>      end
>    end
> end
>
> What I could find until now is that this method does not load all of the
> indexes from DB:
>
> https://github.com/jeremyevans/sequel/blob/2392145025c60d3c127bc1b921130598409f249c/lib/sequel/adapters/shared/postgres.rb#L648
>
>
This is expected behavior:
http://sequel.jeremyevans.net/rdoc/files/doc/reflection_rdoc.html#label-Indexes+on+a+table

The schema dumper doesn't handle database functions, triggers, views, check
constraints, etc. either.  It's fairly limited.  You should use the
database's tools if you want to dump schema and are using more than the
bare minimum of features.

Thanks,
Jeremy

-- 
You received this message because you are subscribed to the Google Groups 
"sequel-talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/sequel-talk/CADGZSSfqSB1vr-raE1iUVWhg_aygTfeLAmDY9UZB1QdWtTbynA%40mail.gmail.com.

Reply via email to