Foreign keys are created with int instead bigint


After recently upgrading our app to Rails 7, I see that when I reset the database (delete db/schema.rb too), the foreign keys are set as type integer instead of bigint.

Does anyone know if anything is changed recently in the Rails codebase? I couldn’t find anything.

Hi Kartikey!

We’re currently facing the same thing in multiple projects, have you been able to find out anything?

Greetings from Germany :slight_smile:

It also happened to me with rails 6 on github-actions. Today, I run bundle update again and the schema issue is fixed.

Most likely related to references/belongs_to method create a column as integer when migration version is 6.0 even if we use PostgreSQL/MySQL · Issue #44268 · rails/rails · GitHub But should have been fixed already