We Recommend

Beginning Ruby: From Novice to Professional Beginning Ruby: From Novice to Professional
Beginning Ruby is a thoroughly contemporary guide for every type of reader wanting to learn Ruby, from novice programmers to web developers to Ruby newcomers. It starts by explaining the principles behind object-oriented programming and within a few chapters builds toward creating a genuine Ruby application.


Posted By

vanne on 01/22/07


Tagged

rails ruby rake


Versions (?)


Who likes this?

1 person has marked this snippet as a favorite

maxkks


Grab current db schema using rake


Published in: Ruby 


URL: http://jayfields.blogspot.com/2006/11/rails-get-schemainfo-version-number.html

put this into lib/tasks and then run rake db:version

  1. namespace :db do
  2. desc "Returns the current schema version"
  3. task :version => :environment do
  4. puts "Current version: " + ActiveRecord::Migrator.current_version.to_s
  5. end
  6. end

Report this snippet 

You need to login to post a comment.