Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

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
  • Loading branch information...
commit 7cc67eb6d76eff9762c2a92866769b43ff5009a5 1 parent 91384dd
David Heinemeier Hansson dhh authored
2  railties/CHANGELOG
View
@@ -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]
2  railties/lib/rails_generator/generators/components/model/templates/migration.rb
View
@@ -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
11 railties/lib/tasks/databases.rake
View
@@ -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
Please sign in to comment.
Something went wrong with that request. Please try again.