0

rake 0.8.7, rails/activerecord 2.3.3

Output from rake db:migrate:

== CreateProducts: migrating ================================================= -- create_table(:products) -> 0.0017s == CreateProducts: migrated (0.0019s) ========================================

Shouldn't the version number, in this case 20090724013528, appear before the migration name?

Bruce Hobbs
  • 116
  • 5
  • To further clarify, the output from the rake db:migrate shown in Agile Web Development with Rails, Third Edition does include the version number: == 20080601000001 CreateProducts: migrating ======================== -- create_table(:products) -> 0.0027s == 20080601000001 CreateProducts: migrated (0.0028s) =============== I'm just trying to figure out if the output from the command has changed or if there's some other problem. – Bruce Hobbs Jul 25 '09 at 00:42

2 Answers2

4

I can't remember 100% but I think they removed the number in that output when they switch migrations over to the UTC timestamps.

You can however check the current version of your DB using:

rake db:version
paulthenerd
  • 9,487
  • 2
  • 35
  • 29
  • Based on the output shown in the book I mentioned in the updated question, the version number was included at some point. Looking at the code for the announce method that generates the output it seems like the @version variable contains a blank rather than the version number. – Bruce Hobbs Jul 25 '09 at 00:59
1

As pointed out by paulsnotes, the timestamp represents the version number. If you really want to switch back to sequential numbers, you can set a flag in environment.rb.

config.active_record.timestamped_migrations = false
Community
  • 1
  • 1
Tate Johnson
  • 3,910
  • 1
  • 23
  • 21