Rails 8: The db:migrate task might not run all migrations in db/migrate/ anymore

Posted . Visible to the public.

In Rails 8 the behavior of the rails db:migrate command has changed for fresh databases (see PR #52830 Show archive.org snapshot ).

  • Before Rails 8: The command runs all migrations in the folder db/migrate/*
  • After Rails 8: The command loads the schema file (db/schema.rb or db/schema.sql) if existing and runs all pending migrations in the folder db/migrate/* afterwards

This speeds up the command. But e.g. migrations with data manipulations are missing.

The only way to run all pending migrations seems to be to delete the schema file. It should be rewritten once the rake task completes.

Last edit
Henning Koch
License
Source code in this card is licensed under the MIT License.
Posted by Emanuel to makandra dev (2025-10-01 13:26)