Welcome Guest, Not a member yet? Register   Sign In
Migration naming: number vs timestamp

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.

Theme © iAndrew 2016 - Forum software by © MyBB