Skip to content

Commit

Permalink
Added db:version to get the current schema number [via Tim Bray]
Browse files Browse the repository at this point in the history
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7110 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
  • Loading branch information
dhh committed Jun 25, 2007
1 parent 91384dd commit 7cc67eb
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 4 deletions.
2 changes: 2 additions & 0 deletions railties/CHANGELOG
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
*SVN*

* Added db:version to get the current schema number [via Tim Bray]

* Added --skip-migration option to scaffold and resource generators #8656 [Michael Glaesemann]

* Fix that FCGIs would leave log files open when asked to shut down by USR2 #3028 [sebastian.kanthak/josh]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ def self.up
create_table :<%= table_name %> do |t|
<% for attribute in attributes -%>
t.<%= attribute.type %> :<%= attribute.name %>
<% end -%>
<% end %>
t.timestamps
end
end
Expand Down
11 changes: 8 additions & 3 deletions railties/lib/tasks/databases.rake
Original file line number Diff line number Diff line change
@@ -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|
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 7cc67eb

Please sign in to comment.