• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Migration naming: number vs timestamp

#1
[eluser]Unknown[/eluser]
It's great to see database migrations make it in to CodeIgniter core.

However, I'd like to suggest that migrations use a timestamp rather than an incremental number to identify them. Our Rails friends used a number to identify migrations, but:
Quote:"...the migration number started at 1 and was incremented each time a migration was generated. With multiple developers it was easy for these to clash requiring you to rollback migrations and renumber them. With Rails 2.1+ this is largely avoided by using the creation time of the migration to identify them."

"For example Alice adds migrations 20080906120000 and 20080906123000 and Bob adds 20080906124500 and runs it. Alice finishes her changes and checks in her migrations and Bob pulls down the latest changes. When Bob runs rake db:migrate, Rails knows that it has not run Alice’s two migrations so it executes the up method for each migration."

I am happy to help with this feature and submit it to the project on Github if there is support for it.


Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2020 MyBB Group.