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
上级 91384dd6
*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]
......
......@@ -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
......
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
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册