Love Fuel?    Donate

FuelPHP Forums

Ask your question about FuelPHP in the appropriate forum, or help others by answering their questions.
How do i alter a model and its migration created with "oil g model"
  • I am very new to this, specially the migration stuff.
    I find out it hard to think of a solution to edit or modify a table that is being created by model, that is being created by oil g model command.

    So how do I modify and create new migration if i need to change a alter a table, that was created by a migration of a model.

    ALSO, Is there a way of no using oil command and still do all code and get a migration generated.

    thank you.
  • HarroHarro
    Accepted Answer
    You can just create a second migration for it, containing the delta?

    See http://fuelphp.com/docs/packages/oil/generate.html#migrations for some magic migrations.

    And if your change is too complex, you can allways create a migration by hand, and add the required DBUtill calls manually.

    And no, currently oil is strictly commandline. For Fuel v2 we're thinking about an oil webapp, but there are no concrete plans or timing.
  • @Harro Verton also what if I create my DB tables manually and then how should i create models and migrations?
  • Make sure your db.php configuration is ok, then run

    oil refine fromdb

    which shows you the different options available.

Howdy, Stranger!

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

In this Discussion