cohesion_friends-migrations
============

Migrations for the cohesion database

setup
---
This project utilizes [iceman](https://git-aws.internal.justin.tv/d8a/iceman) to perform the migrations.

workflow
-------------
#### Create a new migration
Run `iceman create migration SomeSchema` to autogenerate a new yaml file.  Edit the up and down
 sections with the SQL necessary to accomplish your goals. You can also specify a desired timeout for each. 

#### Test on your local postgresql

Apply your changes locally by running `iceman up` from this directory. 

#### If you need to run QA, you can deploy changes to staging
You can use the [deploy tool](http://clean-deploy.internal.justin.tv/#/d8a/cohesion_friends-migrations) and
 test there.  If you don't immediately merge to master, then run `buddy iceman cohesion_friends down`
 in your staging RDS Buddy instance.

Remember that most staging databases clone from production nightly, and you will need to re-deploy daily. 

#### Get reviewed
Once you have the migrations, submit a PR to this repo and invite an experienced database wrangerl to review
 the change.

 * Please provide an explanation of the change or point ot a specification
 * The review should be accompanied with sample queries

#### Deploy to production

Once the PR is accepted, you can merge it and deploy to production with the
 [deploy tool](http://clean-deploy.internal.justin.tv/#/d8a/cohesion_friends-migrations).  Your migration will
 be run automatically.
