This project is archived and is in readonly mode.

#1139 ✓wontfix
Mike Weber

Add the VERSION to the contents of a database migration

Reported by Mike Weber | September 29th, 2008 @ 09:56 PM | in 2.x

If anyone else is like me, when they're developing their database, they may want to remigrate some of their migrations while developing the schema rather than creating multiple migrations to create one table before any real code development has started. In that case, the developer will run 'rake db:migrate:down' and 'rake db:migrate:up' multiple times. Each time the rake command will require the VERSION number, which is now a 14 digit number, much harder to type in than the old-styled 3 digit number. Copying and pasting this VERSION number is usually the preferred route for the lazy developer, but even that method is troubled by having to begin renaming the file, selecting just the numbers and pasting it into the command line.

In the style of 'annotate_models' this patch puts the migration's version number into a comment at the top of the file in the form of 'VERSION=XXXX' which allows developers to quickly copy and paste the suffices of the db:migrate:up/down rake commands.

Also included in this patch is an update to the documentation on migrations, as well as fixing a grammar issue for a rake task's description.

Comments and changes to this ticket

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile »

<h2 style="font-size: 14px">Tickets have moved to Github</h2>

The new ticket tracker is available at <a href="https://github.com/rails/rails/issues">https://github.com/rails/rails/issues</a>

People watching this ticket

Attachments

Pages