Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replace `soda migrate` with `milmove migrate` #2128

Open
wants to merge 18 commits into
base: master
from

Conversation

2 participants
@chrisgilmerproj
Copy link
Contributor

commented May 13, 2019

Description

This puts the migration command inside the milmove binary. The primary reason for doing this is to re-use the DB connection logic we built in and to avoid using the database.yml file that soda prefers. This will enable us to use RDS IAM access in the future.

  • Replace soda migrate with milmove migrate
  • Update docker files and container definitions
  • Update documentation

Reviewer Requests

Should I break out the changes to generate-test-data to a different PR?

Setup

make db_dev_migrate

Code Review Verification Steps

  • Deploy to the experimental environment.
  • Request review from a member of a different team.
  • Have the Pivotal acceptance criteria been met for this change?

References

@chrisgilmerproj chrisgilmerproj self-assigned this May 13, 2019

@chrisgilmerproj chrisgilmerproj changed the title Cg 165203295 milmove migrate Replace `soda migrate` with `milmove migrate` May 13, 2019

@codecov

This comment has been minimized.

Copy link

commented May 14, 2019

Codecov Report

Merging #2128 into master will decrease coverage by 0.01%.
The diff coverage is 50%.

@@            Coverage Diff             @@
##           master    #2128      +/-   ##
==========================================
- Coverage   59.03%   59.02%   -0.01%     
==========================================
  Files         238      238              
  Lines       13796    13803       +7     
==========================================
+ Hits         8144     8147       +3     
- Misses       4662     4665       +3     
- Partials      990      991       +1

@chrisgilmerproj chrisgilmerproj marked this pull request as ready for review May 14, 2019

@chrisgilmerproj

This comment has been minimized.

Copy link
Contributor Author

commented May 14, 2019

Successfully migrated milmove migrate here https://circleci.com/gh/transcom/mymove/109153:

Attempting to get CloudWatch logs for arn:aws:ecs:us-west-2:923914045601:task/app-experimental/2acc58efc7534c06b16eee76a2780e75:
Found task_id 2acc58efc7534c06b16eee76a2780e75 for cluster app-experimental

[
    "{\"level\":\"info\",\"ts\":\"2019-05-14T21:20:12.337Z\",\"caller\":\"milmove/main.go:897\",\"msg\":\"migrator starting up\",\"git_branch\":\"cg_165203295_milmove_migrate\",\"git_commit\":\"f227ea96bac1c487f5ee97614aa74672e27cb598\"}",
    "{\"level\":\"info\",\"ts\":\"2019-05-14T21:20:12.337Z\",\"caller\":\"milmove/main.go:846\",\"msg\":\"checking migration config\",\"git_branch\":\"cg_165203295_milmove_migrate\",\"git_commit\":\"f227ea96bac1c487f5ee97614aa74672e27cb598\"}",
    "{\"level\":\"info\",\"ts\":\"2019-05-14T21:20:12.351Z\",\"caller\":\"cli/dbconn.go:177\",\"msg\":\"Connecting to the database\",\"git_branch\":\"cg_165203295_milmove_migrate\",\"git_commit\":\"f227ea96bac1c487f5ee97614aa74672e27cb598\",\"url\":\"postgres://master:*****@app-experimental.clnb6tcnzkdi.us-west-2.rds.amazonaws.com:5432/app?sslmode=verify-full\",\"db-ssl-root-cert\":\"/bin/rds-combined-ca-bundle.pem\"}",
    "[POP] 2019/05/14 21:20:13 info - > remove-complete-state-from-hhg-shipments",
    "+ readonly migration_file=20190510170742_new-office-user-05-10-19.sql",
    "+ migration_file=20190510170742_new-office-user-05-10-19.sql",
    "+ case $SECURE_MIGRATION_SOURCE in",
    "+ sslmode=require",
    "+ '[' -z transcom-ppp-app-experimental-us-west-2 ']'",
    "+ readonly url=s3://transcom-ppp-app-experimental-us-west-2/secure-migrations/20190510170742_new-office-user-05-10-19.sql",
    "+ url=s3://transcom-ppp-app-experimental-us-west-2/secure-migrations/20190510170742_new-office-user-05-10-19.sql",
    "+ echo 'Applying secure migrations from S3 using url s3://transcom-ppp-app-experimental-us-west-2/secure-migrations/20190510170742_new-office-user-05-10-19.sql'",
    "Applying secure migrations from S3 using url s3://transcom-ppp-app-experimental-us-west-2/secure-migrations/20190510170742_new-office-user-05-10-19.sql",
    "+ set +x",
    "[POP] 2019/05/14 21:20:18 info - > new-office-user-05-10-19",
    "[POP] 2019/05/14 21:20:18 info - 5.8075 seconds",
    "[POP] 2019/05/14 21:20:19 info - dumped schema for app"
]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.