Love Fuel?    Donate

FuelPHP Forums

Ask your question about FuelPHP in the appropriate forum, or help others by answering their questions.
migrations, file prefixes and version numbers
  • I'm new to FuelPHP and new to the concept of migrations. I'm just starting to set up my application and I'm generating models and migrations using oil. Every time I generate a model, the prefix of the migration file that oil creates is incremented. So, after the fifth model is created, the migration file for that table is: 005_create_blahblah. When I run oil refine migrate, I've migrated to version 5, corresponding with the greatest prefix value. It may be because I'm new to the concept of migrations, but this seems unintuitive to me - I should be at version 1, which includes 5 tables in the db. Is this how migrations are supposed to work or am I doing something wrong? It's very likely I'm doing something wrong! Any help would be greatly appreciated - TIA.
  • This is how it works. Every migration file is a migration step. If you want this all to be one version, simply move the up() and down() code from 002 to 005 into 001.
  • Great, thank you for your reply!

Howdy, Stranger!

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

In this Discussion