Love Fuel?    Donate

FuelPHP Forums

Ask your question about FuelPHP in the appropriate forum, or help others by answering their questions.
Alter database table through oil
  • Hi everyone!
    As fuelphp is getting famous due to strong oil utility i would like to ask i want to alter my existing model migration and table through oil is it possible or manually we will alter the table
    oil g modelname fields --force will change the model and migration but oil refine migrate gives me that you are at the latest migration. how will i alter the table through oil.
    Thanks in advance
  • You can't, and shouldn't, modify existing migrations. Migrations are an incremental process, so create "the next one" for each alteration you want to make. The framework knows it has already installed that migration, so it won't execute it again.If you insist on altering an existing migration, you first have to rollback your installed migrations (using migrate:down ) to the point that the original one is rolled back, then alter it, and run all migrations again. And this only works if there are no newer migrations that depend on it. If that is the case, you're altered migrations will break things later in the migration process.
  • Thanks for such a useful information

Howdy, Stranger!

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

In this Discussion