[PR] Fix postgresql/schema_dumper in 8.1 to emit foreign keys after tables

I have an open PR that fixes the Postgres issue where ActiveRecord’s dumped schema can emit foreign_keys before the tables have been emitted.

It’s a bug introduced in Rails 8 and I think it’d be good to get into the next bug release @rafaelfranca took an initial look and it’s based on work done by @fatkodima. Can I get reviews on it please?

Looking at the discord, another person has proposed the same fix: Fix foreign key order and table name prefixing when dumping multiple schemas in postgres by robinator · Pull Request #56072 · rails/rails · GitHub

@robinator closed their PR in favor of mine.

My PR is 3 weeks old now, would love a review from someone who can merge.

Occassionally linking your PR in discord might yield better results, where message volume is lower but maintainers do check it. Please understand that maintainers are very busy and it’s normal to not here back after weeks.

1 Like

Yep, been posting in discord every few days. Just bummed that a patch came out already without this fix in it.