Hello,
I have recently came across a problem with foreign_key_list not working
correctly with partitioned tables on Postgres.
My table is partitioned by hash on some_id column, I have few partitions
attached
some_table_p_hash_p1
some_table_p_hash_p2
...
some_table_p_hash_p16
the table has few foreign keys , e.g. fk_tab1, fk_tab2, ...
When i try SomeTable.db.foreign_key_list(SomeTable.table_name) on a main
table I am getting an empty array []
when I use an actual partition everything is working as expected:
SomeTable.db.foreign_key_list(:some_table_p_hash_p1)
[{:name=>:some_table_tab1_id_fkey, :columns=>[:tab1_id], :key=>[:id],
:on_update=>:no_action, :on_delete=>:cascade, :deferrable=>false,
:table=>:tab1, :schema=>:public},
{:name=>:some_table_tab2_id_fkey, :columns=>[:tab2_id, :org_id],
:key=>[:id], :on_update=>:no_action, :on_delete=>:cascade,
:deferrable=>false, :table=>:tab2, :schema=>:public},..]
Can you please advise how to fix this issue with an actual model table?
Best,
Maria.
--
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/aa2570e5-1e6b-4c71-a52c-f33b831baf35n%40googlegroups.com.