We have moved our forum to GitHub Discussions. For questions about Phalcon v3/v4/v5 you can visit here and for Phalcon v6 here.

Data migrations

I'm wondering how you guys do data migrations.

I want to be able to setup some initial data in new tables, as well as transform data in older ones that got their schema updated, and do it in an automated way, same way that we transform the database schema with migrations.

What I want to do is to have a separate data migrations folder, so on my testing environment I would apply only the schema migrations (for testing purposes, tables should be empty and only populated by fixtures), but on my staging and production environments the data migrations would be applied as soon as the schema migrations are done.

Has anyone solved this? Is there any tool that Phalcon provides to do so?



43.9k

Hi,

does phalcon-devtools migration not fit your needs ?

does phalcon-devtools migration not fit your needs ?

No, because I don't find a way to separate schema migrations from data migrations. I want to be able to execute only schema migrations for my testing system, and then on production execute both schema and data migrations.



75

I suggest to try Full Convert by Spectral Core.



21.7k
edited Oct '15

Unfortunately, Windows only. Plus, paid. But thank you for sharing new software solution with us!

I suggest to try Full Convert by Spectral Core.



32.2k
edited Oct '15

It will depend on your workflow. I use MySQL Workbench most of the times You can use it to syncronize, forward and reverse engineer databases. I has features for Schema transfer and Migrations.

I have a model of my database along with an ERR Diagram created in Workbench. Everytime I change the schema I use the Forward Engineer or the Syncronize Model option to connect to the database I want to update!

https://www.mysql.com/products/workbench/migrate/



75
edited Oct '15

Actually, it can can be installed on Linux OS or Mac, but only under virtualization software. And trail is indeed limited, just not sure how much. And you are welcome. :)

Unfortunately, Windows only. Plus, paid. But thank you for sharing new software solution with us!

I suggest to try Full Convert by Spectral Core.