rage / mooc.fi

https://mooc.fi
5 stars 6 forks source link

update postgres and redis in docker-compose #1212

Closed mipyykko closed 1 year ago

mipyykko commented 1 year ago

We've migrated up to version 15 of Postgres in production, so better have the dev database running the same major version as well.

As the dev database is created with the older version, it is not usable with the newer one straight away. To keep the old one, have the old version running in docker compose -- if you've already merged this, just change the image back to postgres:10.3 -- and do a pg_dump, preferably with a version included in Postgres 15 which you should have installed locally:

pg-dump -h localhost -p 5678 -U prisma -W > /tmp/moocfi-dev-dump

Provide prisma for the password.

Do docker compose down and you can delete the container and the volume:

docker container rm backend-postgres-1
docker volume rm backend_postgres

Change the image version back to postgres:15.3, do docker compose up and it should create the database. While it's running, restore the database contents:

psql -h localhost -p 5678 -U prisma -W prisma < /tmp/moocfi-dev-dump
codecov[bot] commented 1 year ago

Codecov Report

Merging #1212 (5f23266) into master (4043c04) will increase coverage by 0.04%. The diff coverage is 85.71%.

@@            Coverage Diff             @@
##           master    #1212      +/-   ##
==========================================
+ Coverage   64.18%   64.23%   +0.04%     
==========================================
  Files         124      124              
  Lines        5314     5318       +4     
  Branches     1233     1234       +1     
==========================================
+ Hits         3411     3416       +5     
+ Misses       1774     1773       -1     
  Partials      129      129              
Flag Coverage Δ
backend 64.23% <85.71%> (+0.04%) :arrow_up:

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
backend/tests/index.ts 95.45% <85.71%> (+1.40%) :arrow_up:

:mega: We’re building smart automated test selection to slash your CI/CD build times. Learn more