Jump to content

How to run database migrations?

Recommended Posts

I need to add new columns to some of the core tables. For development I use the 4.1.5-dev(latest master branch). Following these instructions I created new migration files but when I perform an upgrade or install my database changes aren't applied. To upgrade the adserver I follow these instructions, however I'm not sure that is the correct way to run migrations for developers.

As for new install I managed to get my database updated by executing this script `scripts/upgrade/buildXmlCache.php`. It created a set of *.bin files which probably are required for installation. But it didn't help for the upgrade process. The database stays at the 623 version.

Share this post

Link to post
Share on other sites

Hi @Alexander,

If you are doing this as a custom development, I would probably avoid using the core migration system, as it will render your system unable to upgrade in the future - we're likely to want to re-use your migration numbers, and things will conflict.

If you can, I'd also suggest that you don't add columns to the core tables - this may have a similar effect with rendering upgrades impossible.

Better if you can create separate tables for your data, and join the data using the relevant IDs.

Share this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now