As an Elixir developer who cares about system up-time and avoiding "scheduled maintenance" windows, and more importantly avoiding "unscheduled maintenance" windows 😉, this guide dives deep into Ecto database migrations and how they can be used safely in production systems.
This is guide comes in a 4 part series of posts. The guide helps you:
- Understand Ecto migrations
- Migrate and rollback the database using Mix releases
- Avoid pitfalls during migrations
This guide includes a set of recipes for common migration scenarios. You can jump ahead to those, but it is helpful to understand what's going on at a deeper level and to get your project setup ahead of time for running migrations in a production environment and
Note: This guide uses PostgreSQL and may differ if you're using a different database. I'll note where differences may be, but I do not go into depth on different database systems. This was also written using Ecto 3.6.x.
Guide Table of Contents
- Part 1: Anatomy of an Ecto migration
- Part 2: How to migrate Mix Release projects
- Part 3: Migration Recipes
- Part 4: Backfilling Data