Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

  1. Stop the existing container: docker stop sunwave-mysql

  2. Remove the container: docker rm sunwave-mysql

  3. Remove the docker image: docker rmi 517729021141.dkr.ecr.us-east-1.amazonaws.com/sunwave-mysql:1.0.0-SNAPSHOT

  4. Login into our aws docker registry: aws ecr get-login-password --region us-east-1 --profile sunwave-dev | docker login --username AWS --password-stdin 517729021141.dkr.ecr.us-east-1.amazonaws.com

  5. Pull the new image, create the container and run it: docker run --platform linux/amd64 -p 3306:3306 --name sunwave-mysql --network sunwave -e MYSQL_ROOT_PASSWORD=Welcome1 -d 517729021141.dkr.ecr.us-east-1.amazonaws.com/sunwave-mysql:1.0.0-SNAPSHOT --lower_case_table_names=1

  6. Make sure it’s running: docker logs sunwave-mysql Note the initial setup up will take a few minutes:

Update the data.

  1. Get a dump of insert statements of your existing database: docker exec -i sunwave-mysql sh -c "mysqldump -u root -p'Welcome1' --skip-extended-insert sunwave3" > sunwave3-insert-statements.sql

  2. Pull out the table you need to update: cat sunwave3-insert-statements.sql | grep sw_timeline_task > insert_sw_timeline_task.sql

  3. Modify the sql file by copy the existing insert statement and modifying to suit your needs.

  4. Remove old insert statements.

  5. Update https://github.com/sunwavehealth/devops/blob/develop/database/docker/3_wack-o-mole.sql file

  6. Reinstall the docker image see

Update the database structure.

...