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/distributed-state-is-hard-5a0d384c2f3c
New
brainlid
Livebook was created for machine learning in Elixir but Livebook isn’t limited to machine learning. I found it works really well for docu...
New
RudManusachi
Hi there! Recently I was playing around with extracting and updating data in the DB and for fun challenged myself to try to implement a ...
New
sashaafm
How to use the blogs section You can post links to your blog posts either in one of the Official Blog Posts threads (like this one), or, ...
296 25328 131
New
alvises
Just published the first part of series of articles aimed to explain the architecture behind a kv-store engine written in Elixir and impl...
New
paulanthonywilson
This is an overview of different ways to try and kill an OTP process (in Elixir) and the behaviour to expect when that happens. I know th...
New
brainlid
You are storing some Phoenix LiveView state in the browser. You want to retrieve that saved state as early as possible to improve the use...
New
mssantosdev
This post is a guide on how Norba and I are building LiveMatch, a real-time app for soccer to follow multiple games in one place. https:...
New
hauleth
I wanted to write down some of the main guides I use when writing Elixir tests, so I have summarised them in blogpost. Furthermore, I th...
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

Other popular topics Top

sen
Hi All, I set a environment variables in dev.exs , like below code. when i start server, how can i set the ${enable} value? thanks. d...
New
jononomo
I am trying to figure out how Mix knows whether the environment is test, dev, or prod – where is this set? Thanks.
New
chrismccord
This release brings a number of exciting features, including integration with the new Phoenix LiveDashboard and Phoenix LiveView. There h...
New
JorisKok
I have a server on AWS, and was running a load test using artillery. When looking at the Phoenix dashboard I see the Ports going to 100% ...
New
sergio_101
I am VERY much an elixir newbie. I have taken one elixir course and one phoenix course on Udemy. During that course, I saw the instructor...
New
fayddelight
I tried installing elixir 1.11.2 erlang 23.3.4 via asdf in my zsh shell. Enabled the versions locally and globally. When I list them ...
New
nobody
Hi! In PHP: $_SERVER[‘SERVER_ADDR’] - in Elixir? Searched the docs for ip address and the web, no good results. Thanks!
New
komlanvi
Hi everyone, I was playing with phoenix liveView but I run into an issue. I have a form and want to validate each input text when the te...
New
PeterCarter
There are pre-rolled solutions for other frameworks that do work. However, Phoenix does not seem to have these. Have people had good expe...
New
svb
Hi! Currently I want to submit a form by pressing the Enter key. However, since my input field is of type “textarea” this is just adds a...
New

We're in Beta

About us Mission Statement