rails db:migrate:even_safer
summary
Covers concrete, battle‑tested techniques for live schema evolution: using ignored_columns workaround to avoid prepared statement cache failures, adding constraints with add_check_constraint ... not valid then validating to avoid access exclusive locks, a six‑step safe column‑type migration (new column, sync via triggers or callbacks, batched backfill, add indexes, swap, drop), and a Weedmaps case study replacing a table with sidekiq batches for backfill. Examples target Postgres and Rails (6.1+), show full rollout order, and report successful production execution.
AI-written summary · about
chapters (11)
- 0:00Start
- 2:53Rails Db Migrate Safely
- 4:22Lock Modes
- 5:09Why these Migrations Can Be Dangerous
- 11:59Adding a Column Prepared Statements
- 19:51Adding a Check Constraint
- 21:27Add Check Constraint
- 26:03Triggers at the Database Level
- 27:28Callbacks
- 32:07Sanity Check
- 42:11Indexes Foreign Keys and Other Constraints
related talks
40mrails db:migrate:safely
30mPuny to Powerful PostgreSQL Rails Apps
36mUp And Down Again: A Migration's Tale
21mAgents on GuardRails: Deterministic Safety for Database Operations
43mHow to avoid database migration hell
33mPeaceful Django Migrations with Efe Öge
56mSane schema migrations with Alembic and Postgres
34mBeyond CRUD: the PostgreSQL techniques your Rails app is missing.
