Love Fuel?    Donate

FuelPHP Forums

Ask your question about FuelPHP in the appropriate forum, or help others by answering their questions.
Migration version collisions?
  • Hello, I've just recently started with Fuel, and can't wait to get into it more. It's amazing so far. Already building an app on it. One significant issue which can be a pain though: You are working with another programmer on an application. You both are at migration version 2. You both need to write a migration. Both migrations which you both wrote is now version 3. You get a collision. This also breaks source control, because you have to rename the file. Now your other developer has a completely different file than you have, and possibly a different version. It all just seems to go crazy. Ruby on Rails solves this by using timestamps. Is there any plans to address this issue? Thanks! And I love this framework!
    Paul
  • Old topic, I know, but I can't find anywhere else that this is mentioned. I feel a more Rails-like Migration system is definitely needed. In a multi-person development team, working on several feature branches, the current Migrations system built into Fuel is absolutely useless. To use it would require too much thought to keep migration numbers in sync, so we are simply not using migrations just yet (which is bad enough itself). An over-haul of how Migrations work should be on the cards for the next major Fuel release. I'd be happy to assist in working on a system to achieve this.
  • @Phil, I think this should go on the roadmap for 2.0. @danharper, Could you check if this has been reported already (at http://github.com/fuel/core/issues), and if not, add a feature request so it doesn't get lost?
  • Couldn't find anything, so opened a new issue: https://github.com/fuel/core/issues/843
  • Steps were made to get this working but I'll need to look into how far we got. Basically the Migration library wont care if you go from 68 to 70 now, meaning that all we need to do is change the generated migraitons to use a timestamp. I think I did that... but don't have time to find out. Will sort it out soon either way.
  • Hey Paul, Welcome to the Fuel community. I'm not aware of anything that solves this issue currently...but you bring up a great point here. I suppose the first order of business would be to resolve the possibility of a naming collision in FuelPHP migrations. It looks like rails just prepends a UTC timestamp to each migration and they get run in order of the time created. Does it actually check for conflicts between the migrations themselves? Anyone else have any thoughts?
  • This is something I have been pondering for a while and yes of course I am aware of how this is done in other frameworks. The reasoning here is in two parts: 1. This is a conversion of my CodeIgniter Migrations implementation. CI has no command line utility so programatically making migrations is not possible. For that reason it is kept simple with just 1, 2, 3. 2. If git-flow is used this should not be an issue, as you should save the migrations as XXX_Add_foo until they are ready to merge. I have only had a problem with this when there are a few people on the job and nobody is paying attention to the develop branch, but I see no reason why we cannot convert to timestamps if enough people want it.

Howdy, Stranger!

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

In this Discussion