使用rake获取当前db模式

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了使用rake获取当前db模式相关的知识,希望对你有一定的参考价值。

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

以上是关于使用rake获取当前db模式的主要内容,如果未能解决你的问题,请参考以下文章