Database migration

Hey there, I’m really interested by how you run database migrations using docker stack in a swarm.

How do you do if before running docker stack deploy -c docker-stack.yml my-app you have to run a migration and you don’t want your containers not updated yet to throw errors because the database schema is different?