How upgrade database since v12?

Now Directus is on a hardened docker image, what’s the correct way to upgrade the database following a container update?

My flow used to be:

docker compose pull
docker compose down
docker compose run --rm {directus} npx directus database migrate:latest
docker compose up -d

but now npx and database modules ‘cannot be found’.

What should I do instead to bring my postgres database up-to-date following a Directus upgrade?

Thanks.

2 Answers

2

Just like before the dhi containers, in the official image migrations are part of the boot proces.

So if you update Directus (for example going from 12.1.0 to 12.1.1), booting the new image should run the migrations automatically. No manual step needed.

Hi @jogchum. That was how I thought it was supposed to work but I've always had to make the migration process part of my workflow. I've had upgrades break the install until I've run the migration manually. I used to be on mysql though until moving everything to Postgres. I know there was some lack of faith with mysql when talking to the Directus team :thinking:

Hey @David_O, I hope you’ve been well! I’m checking you saw Matt’s post: Heads up! We're moving to a hardened Docker image. Here's what that means

Hey @beth all good here thanks! I did see the article but it never mentioned database upgrades to do after the Directus update. Ps. Thanks for the socks!