OpenSourceFellows / amplify-back-end

The API backend for ProgramEquity
https://www.programequity.com/
MIT License
11 stars 0 forks source link

Database migrations to put local DB into parity with production #138

Closed JamesMGreene closed 2 years ago

JamesMGreene commented 2 years ago

This PR contains a series of Knex database migrations that should put local development/test databases into parity with the production database (in Heroku).

:warning: Some of these migrations are making arguably negative changes, such as removing NOT NULL constraints and indexes. 🙅🏻 Rest assured, this is intentional to get our databases into parity but I will follow-up with another PR of migrations to re-apply these positive precautions across the board. 👌🏻

:mega: Importantly, this also adds a heroku-postbuild npm script to automatically execute the latest database migrations in production upon deployment (via internal hooks in the heroku/nodejs buildpack that our Heroku App uses).

As part of this update, I have also manually inserted knex_migrations records 3-9 into the production database in order to avoid attempting to run migrations that have effectively already happened (outside of Knex migrations):

image

JamesMGreene commented 2 years ago

@BeeXiong @teakopp @nawazkhan Still would like someone to give this a review but I can YOLO-admin-merge it if I must. 😅 🙏🏻

manishapriya94 commented 2 years ago

@andyfeller @wallace thoughts here?

JamesMGreene commented 2 years ago

Made the call to merge this without a review after waiting for a long time. 🤷🏻‍♂️