Love Fuel?    Donate

FuelPHP Forums

Ask your question about FuelPHP in the appropriate forum, or help others by answering their questions.
How can models be updated using php oil?
  • 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?
  • philipptempelphilipptempel
    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
  • 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.
  • HarroHarro
    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...
  • Thanks Harro Verton...
    That's good to know.. But how can I generate a migration for a model class I already have?

        
  • Without having the table you mean, no, that does not exist (as part of the framework).

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

In this Discussion