Company
Date Published
Author
Samuel Cochran
Word count
1004
Language
English
Hacker News points
None

Summary

Buildkite, a Rails majestic monolith with a large PostgreSQL database, recently migrated one of its biggest tables from integer to bigint primary keys to prevent potential integer overflows. The migration process involved adding a new column with the bigger data type, backfilling the new column for existing records, and swapping the columns. ActiveRecord migrations were used for all database changes, ensuring zero-downtime throughout the entire process. Foreign key tables were also updated using similar strategies.