Love Fuel?
Donate
About
Forums
Discussions
Login
FuelPHP Forums
Ask your question about FuelPHP in the appropriate forum, or help others by answering their questions.
General
How can models be updated using php oil?
JeanAlesi
July 2015
I have a model "Users" that I need to add another table to...
I added the extra property inside the corresponding model class, then I went to phpmyadmin and added the table (all manually)..
Is there a way to do this using php oil?
philipptempel
July 2015
Accepted Answer
You can create a migration for creating the respective table. Then you'd just need to call `$ oil r migrate` and you're all set
JeanAlesi
July 2015
Thank you...
Now, the next question is: How can I generate a migration that takes a model that already exists, for which there is no migration?
I don't think any of the examples in the documentation contemplate this scenario.
Harro
July 2015
Accepted Answer
There is a task called "fromdb", that will generate a migration from an existing table.
You will have to verify the result, not all info needed can be extracted from the database...
JeanAlesi
July 2015
Thanks Harro Verton...
That's good to know.. But how can I generate a migration for a model class I already have?
Harro
July 2015
Without having the table you mean, no, that does not exist (as part of the framework).
Add a Comment
Howdy, Stranger!
It looks like you're new here. If you want to get involved, click one of these buttons!
Sign In
Apply for Membership
Categories
All Discussions
5,089
General
↳ General
3,364
↳ Job Board
13
↳ Installation & Setup
214
Packages
↳ Oil
213
↳ Orm
700
↳ Auth
261
Development
↳ Tips and Tutorials
126
↳ Code share
145
↳ Applications
52
In this Discussion
Harro
July 2015
JeanAlesi
July 2015
philipptempel
July 2015