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

Migrations - renaming columns

Is there a way to rename a column in the migrations?

Also, how does the migrations know what version of the database is currently being used? It seems like whenever we run the migrations tool it executes all the available migrations?

Thanks in advance!



98.9k

No, isn't a way to rename a column since this feature is not supported by all the database systems.

It takes the migration in the file .phalcon/migration-version: https://github.com/phalcon/phalcon-devtools/blob/master/scripts/Phalcon/Migrations.php#L171

Thanks for the speedy reply...!

In our current project we're using to trial the Phalcon framework, we've set up a separate loader class that handles loading different config files based on the environment and as a result we require the database version to be stored on a "per-environment" basis. Are there any plans to move the version control in to the database itself?

I guess not!