RepoJournal
Rails

@rails

Ruby on Rails — Shopify, Basecamp, GitHub all run on it

Pick a date

Topics: Ruby Full archive →

The Wire · Showcase

SQLITE3 FOREIGN KEYS GET THEIR NAMES BACK

By RepoJournal · Filed · About Rails

SQLite3 migrations just stopped silently destroying the wrong foreign keys.

Rails merged three critical fixes for SQLite3 schema introspection that were causing migrations to behave unpredictably [1]. The core issue: `foreign_keys` wasn't reading constraint names from the schema, so every `ForeignKeyDefinition` came back with `name == nil`. This meant `remove_foreign_key(table, name: "fk")` ignored your target constraint and deleted an arbitrary one instead [1]. The same blind spot broke `if_not_exists:` on both `add_check_constraint` and `add_foreign_key` [2], leaving SQLite3 users without options that MySQL and PostgreSQL had long since fixed. Two merges landed overnight: one restoring name reading from the schema [3], the other honoring the `if_not_exists:` flag in adds and removes [2]. Rails also landed a quality-of-life fix letting `relative_time_in_words` accept `Date` and numeric inputs directly [4], plus a cleanup removing unnecessary reverse calls [5]. Over in Solid Queue, the Puma plugin tests got smarter about port allocation, ditching hardcoded 9222 for dynamic assignment to stop EADDRINUSE cascade failures [6].

Action items

References

  1. [1] Read foreign key names from the schema on SQLite3 rails/rails
  2. [2] Honor if_not_exists in SQLite3 add_check_constraint and add_foreign_key rails/rails
  3. [3] Merge pull request #58091 from 55728/fix-sqlite3-add-check-constraint-if-not-exists rails/rails
  4. [4] Merge pull request #58092 from 55728/fix-relative-time-in-words-non-time-inputs rails/rails
  5. [5] Remove unnecessary reverse call rails/rails
  6. [6] Use dynamic port allocation in Puma plugin tests rails/solid_queue

Quick answers

What shipped in Rails on July 13, 2026?
SQLite3 migrations just stopped silently destroying the wrong foreign keys. In total, 16 commits and 8 pull requests landed.
Who contributed to Rails on July 13, 2026?
4 developers shipped this update, including Xavier Noria, Kenta Ishizaki, fatkodima, and Diogo Vernier.
What were the notable Rails updates?
Read foreign key names from the schema on SQLite3, Honor if_not_exists in SQLite3 add_check_constraint and add_foreign_key, and Merge pull request #58091 from 55728/fix-sqlite3-add-check-constraint-if-not-exists.

More from @rails

Daily updates, in your inbox

Follow Rails

Ruby on Rails — Shopify, Basecamp, GitHub all run on it We'll email you a link to confirm first.

Free. Confirm via email. Unsubscribe in one click.

— or follow the whole beat:

Elsewhere on the wire