Symfony doctrine migrations up and down

Email this to someoneShare on Google+Share on FacebookTweet about this on TwitterShare on LinkedIn

Problem

You would like to run a migration in a symfony 2x project either up or down.

Solution

You can run the following for getting a migration up or down:

Bash script to add environment and date in Symfony appversion.yml file

Email this to someoneShare on Google+Share on FacebookTweet about this on TwitterShare on LinkedIn

Problem

You are using CI/CD to deploy a Symfony application that has the appversion.yml configuration file, and you want to add the environment and a timestamp to it after deployment.

Solution

You can achieve this by creating and running a bash script like the following and passing the environment as a variable (ie script_name env) :