Skip to content

Latest commit

 

History

History
32 lines (23 loc) · 1.04 KB

migrations.md

File metadata and controls

32 lines (23 loc) · 1.04 KB
title
Database Migrations

A common task is to run database migrations with newer code before deploying the code. This is easily achieved with the ufo task command. Here's an example:

ufo task demo-web -c bundle exec rake db:migrate

It is nice to wrap the commands in a wrapper script in case you have to do things like to load the environment.

ufo task demo-web -c bin/migrate

The bin/migrate script can look like this:

#!/bin/bash
bundle exec rake db:migrate

The ufo task command is generalized so you can run any one-off task. It is not just limited to running migrations. The ufo task command performs the following:

  1. Builds the docker image and pushes it to a registry
  2. Registers the ECS Task definition
  3. Runs a one-off ECS Task

Back Next Step

Pro tip: Use the <- and -> arrow keys to move back and forward.