The Phoenix Files

Phoenix and LiveView applications are awesome on Fly.io! This is the home for Phoenix-oriented content ranging from Ecto to LiveView and more.

A series by David Bernheisel
Introduction

Safe Ecto Migrations

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 saf...

Read more 

Read more
Safe Ecto Migrations
Part 1

Anatomy of an Ecto migration

In order for us to create and run safe Ecto migrations on our database, it is helpful to understand what is _actually_ happening with the database. To do that, we'll dig deeper into how Ecto migrations work by looking both at the code being execut...

Read more 

Read more
Safe Ecto Migrations
Part 2

How to migrate Mix Release projects

Not long ago, deploying and managing Elixir projects was not as straight-forward as today; some might say it was downright painful. Thankfully, since Elixir 1.9, Mix ships with tools to help developers assemble applications for deployment.

Read more 

Read more
Safe Ecto Migrations
Part 3

Migration Recipes

This is a non-exhaustive guide on common migration scenarios and how to avoid trouble. These migration recipes may evolve over time, so be sure to check the git edition of these recipes at https://github.com/fly-apps/safe-ecto-migrations with up-t...

Read more 

Read more
Safe Ecto Migrations
Part 4

Backfilling Data

When I say "backfilling data", I mean that as any attempt to change data in bulk. This can happen in code through migrations, application code, UIs that allow multiple selections and updates, or in a console connected to a running application.

Read more 

Read more