Grab current db schema using rake


/ Published in: Ruby
Save to your folder(s)

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


Copy this code and paste it in your HTML
  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

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

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.