Until we get CI setup to be able to run this and the Sequelize migrations we will do this manually.
- Login to console and get the cluster you want to use as portfoward host
- Copy Cluster name
- Copy Task ID
- Copy Container ID for the
backend
container - Copy the RDS host name you are connecting to
- Login to your profile via the terminal
- Run the following to enable port forwarding after replacing all values wrapped in
<>
AWS_PROFILE=<your profile> aws ssm start-session --region us-east-1 --target ecs:<cluster name>_<task id>_<container id> --document-name AWS-StartPortForwardingSessionToRemoteHost --parameters host="<rds hostname>",portNumber="5432",localPortNumber="6432"
- Start a port forward connection from above
- Update your .env.migrate file to point to have the correct connection details to the db you are connecting to
- Run
NODE_ENV=migrate<env> npm run db-status -- --debug
to validate what is going to run - Run
NODE_ENV=migrate<env> npm run db-up -- --debug
to execute the migrations