brainlid

brainlid

Elixir Blog Post: Safe Ecto Migrations - Recipes and Resources

There is a new community resource available on writing “Safe Ecto Migrations”. When we get a migration wrong, it can lock up your production servers with table locks!

This 4 part guide walks through:

  • Understanding Ecto migrations and what Postgres is actually doing
  • Setting up your mix release project for running migrations
  • Recipes for safely making many common changes
  • How to safely make batch data changes
  • Includes a Github repo with samples!

I hope this becomes a valuable resource for the Elixir community!

Most Liked

tadasajon

tadasajon

Wow, just in time – my partner and I are about a month away from going live with an app deployed on Fly and managing migrations after we go into production is the thing I’m most concerned about. This series looks to be invaluable. Thank you so much!

AstonJ

AstonJ

Nice post @brainlid (and @dbern!) - I love ‘recipes’ in fact I keep hinting to PragProg about hoping to see a Phoenix Recipes book like Rails Recipes (which I used a lot!) - perhaps you two could pitch the idea to them? :003:

What app is it @tadasajon? I ask because I see you are in Costa Rica and I have toyed with the idea of moving there (it’s warmer than here!) hence wondering whether your app will be used by people there :lol:

tadasajon

tadasajon

The app is called QuizDrill and it involves Telegram bots aimed at the Indian marketplace. As for Costa Rica, I guess I should update my profile – I moved back to the US a couple of months ago. Now that winter is coming it may be time to revisit Costa Rica, however. In many ways it is paradise on Earth.

Where Next?

Popular in Blog Posts Top

jordiee
https://medium.com/@jpiepkow/team-based-login-with-accesspass-be236d4bd7dd
New
Paradox
Testing is an important part of any modern piece of software. But writing tests can quickly become an exercise in frustration, with tons ...
New
AstonJ
Elixir Blog Posts How to use this section You can post links to your blog posts either in one of the Official Blog Posts threads, or, vi...
New
paulanthonywilson
So you’re enjoying using WebSockets with Elixir’s Phoenix Framework, and you want to send some binary messages. Maybe it’s an audio clip,...
New
New
brainlid
In a 2 day spike, I created my own Elixir-based AI Personal Fitness Trainer! The surprising part for me was how useful and helpful I foun...
New
bencoppock
I write about the frustration that can occur when dealing with string and atom-based keys in maps and how to (safely) translate string-ba...
New
ryanrborn
A long-running GenServer holds orders, positions, strategy state, and operational flags for a system trading real capital. The post walks...
New
shanesveller
Introduction and first content post in my new series about running Elixir Phoenix apps on Kubernetes are live! I’m describing an opiniona...
New
bemesa21
Add drag-and-drop functionality to your Phoenix LiveView app with SortableJS and LiveView Hooks! This posts shows you how to create an in...
New

Other popular topics Top

danschultzer
None of the current solutions worked well for me, so I went ahead and built a user management system from scratch. This project took far...
548 29377 241
New
aadeshere1
I have a another noob question about loop. Since elixir is immutable, while loop is not directly possible. total = 10 while total != 0 ...
New
marius95
Hello everyone, I try to use an Javascript Event Handler in my root.html.leex file. Therefore I created a function in the app.js file: ...
New
Harrisonl
We have an ECS cluster with 4 services, where each task joins a single cluster, via discovery ECS discovery service. Currently when I de...
New
electic
Hi, I am new to Elixir. I am trying to use the DateTime component to insert a date into MySQL however the there seems to be no way to fo...
New
joeerl
Hello again - after a longish gap I’ve decided I really must dig into Elixir and see what’s been happening here - so I have a few questio...
New
Emily
I have VueJS GUIs with the project generated using Webpack. I have Elixir modules that will need to be used by the VueJS GUIs. I forese...
New
bsollish-terakeet
Credo is smart enough to check for (something like) this: assert length(the_list) == 0 with this response: Checking if an enum is empt...
New
sergio
Kind of like when jquery came out, it was super necessary. Existing drag and drop libraries have a bunch of baggage to support old browse...
New
lanycrost
Hi everyone! I need implement if…else if…else condition from my elixir code, and anymore of this control flow structures not work proper...
New

We're in Beta

About us Mission Statement