I wanted to update propel generated classes that are present in the model folder as I have modified my database schema (i.e., I have added one column in a table). What are the steps to update the model classes?
Please follow below steps to update propel model classes:
Remove all the files inside the /vendor
folder of your application
execute the below command from the folder where composer.json
exists
$ composer update
set the path variable to /path/to/vendor/bin folder
Run the propel reverse task to generate schema.xml specifying your database credentials
$ propel reverse "mysql:host=localhost;dbname=db;user=root;password=pwd"
Output of above command will be schema.xml
file
Replace your schema.xml
file in the project with this new one
From the command prompt go to the folder where you copied schema.xml
file and execute below commands.
$ propel sql:build
$ propel model:build
Thats it. Propel model classes should get updated.