diff options
author | David Heinemeier Hansson <david@loudthinking.com> | 2007-06-25 15:15:20 +0000 |
---|---|---|
committer | David Heinemeier Hansson <david@loudthinking.com> | 2007-06-25 15:15:20 +0000 |
commit | 7cc67eb6d76eff9762c2a92866769b43ff5009a5 (patch) | |
tree | cbcdc2f351792be96df0e74ab49b65c48ada843c /railties/lib/tasks | |
parent | 91384dd691bebfaafcd06a097ea3497512227f47 (diff) | |
download | rails-7cc67eb6d76eff9762c2a92866769b43ff5009a5.tar.gz rails-7cc67eb6d76eff9762c2a92866769b43ff5009a5.tar.bz2 rails-7cc67eb6d76eff9762c2a92866769b43ff5009a5.zip |
Added db:version to get the current schema number [via Tim Bray]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7110 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'railties/lib/tasks')
-rw-r--r-- | railties/lib/tasks/databases.rake | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/railties/lib/tasks/databases.rake b/railties/lib/tasks/databases.rake index fcde596ab3..4eea6b30c1 100644 --- a/railties/lib/tasks/databases.rake +++ b/railties/lib/tasks/databases.rake @@ -1,5 +1,4 @@ -namespace :db do - +namespace :db do desc 'Creates the databases defined in config/database.yml (unless they already exist)' task :create => :environment do ActiveRecord::Base.configurations.each_value do |config| @@ -76,7 +75,13 @@ namespace :db do puts 'sorry, your database adapter is not supported yet, feel free to submit a patch' end end - + + desc "Retrieves the current schema version number" + task :version => :environment do + puts "Current version: " + + ActiveRecord::Migrator.current_version.to_s + end + namespace :fixtures do desc "Load fixtures into the current environment's database. Load specific fixtures using FIXTURES=x,y" task :load => :environment do |