Skip to content
This repository
Browse code

Silence even more noisy rake task docs

  • Loading branch information...
commit fa15111d30f05edac7e4f63264e25887a5a4ae20 1 parent 29acc17
David Heinemeier Hansson dhh authored

Showing 1 changed file with 12 additions and 12 deletions. Show diff stats Hide diff stats

  1. +12 12 activerecord/lib/active_record/railties/databases.rake
24 activerecord/lib/active_record/railties/databases.rake
@@ -134,7 +134,7 @@ namespace :db do
134 134 end
135 135
136 136
137   - desc "Migrate the database through scripts in db/migrate and update db/schema.rb by invoking db:schema:dump. Target specific version with VERSION=x. Turn off output with VERBOSE=false."
  137 + desc "Migrate the database (options: VERSION=x, VERBOSE=false)."
138 138 task :migrate => :environment do
139 139 ActiveRecord::Migration.verbose = ENV["VERBOSE"] ? ENV["VERBOSE"] == "true" : true
140 140 ActiveRecord::Migrator.migrate("db/migrate/", ENV["VERSION"] ? ENV["VERSION"].to_i : nil)
@@ -142,7 +142,7 @@ namespace :db do
142 142 end
143 143
144 144 namespace :migrate do
145   - desc 'Rollbacks the database one migration and re migrate up. If you want to rollback more than one step, define STEP=x. Target specific version with VERSION=x.'
  145 + desc 'Rollbacks the database one migration and re migrate up (options: STEP=x, VERSION=x).'
146 146 task :redo => :environment do
147 147 if ENV["VERSION"]
148 148 Rake::Task["db:migrate:down"].invoke
@@ -173,14 +173,14 @@ namespace :db do
173 173 end
174 174 end
175 175
176   - desc 'Rolls the schema back to the previous version. Specify the number of steps with STEP=n'
  176 + desc 'Rolls the schema back to the previous version (specify steps w/ STEP=n).'
177 177 task :rollback => :environment do
178 178 step = ENV['STEP'] ? ENV['STEP'].to_i : 1
179 179 ActiveRecord::Migrator.rollback('db/migrate/', step)
180 180 Rake::Task["db:schema:dump"].invoke if ActiveRecord::Base.schema_format == :ruby
181 181 end
182 182
183   - desc 'Pushes the schema to the next version. Specify the number of steps with STEP=n'
  183 + # desc 'Pushes the schema to the next version (specify steps w/ STEP=n).'
184 184 task :forward => :environment do
185 185 step = ENV['STEP'] ? ENV['STEP'].to_i : 1
186 186 ActiveRecord::Migrator.forward('db/migrate/', step)
@@ -190,7 +190,7 @@ namespace :db do
190 190 desc 'Drops and recreates the database from db/schema.rb for the current environment and loads the seeds.'
191 191 task :reset => [ 'db:drop', 'db:setup' ]
192 192
193   - desc "Retrieves the charset for the current environment's database"
  193 + # desc "Retrieves the charset for the current environment's database"
194 194 task :charset => :environment do
195 195 config = ActiveRecord::Base.configurations[Rails.env || 'development']
196 196 case config['adapter']
@@ -208,7 +208,7 @@ namespace :db do
208 208 end
209 209 end
210 210
211   - desc "Retrieves the collation for the current environment's database"
  211 + # desc "Retrieves the collation for the current environment's database"
212 212 task :collation => :environment do
213 213 config = ActiveRecord::Base.configurations[Rails.env || 'development']
214 214 case config['adapter']
@@ -225,7 +225,7 @@ namespace :db do
225 225 puts "Current version: #{ActiveRecord::Migrator.current_version}"
226 226 end
227 227
228   - desc "Raises an error if there are pending migrations"
  228 + # desc "Raises an error if there are pending migrations"
229 229 task :abort_if_pending_migrations => :environment do
230 230 if defined? ActiveRecord
231 231 pending_migrations = ActiveRecord::Migrator.new(:up, 'db/migrate').pending_migrations
@@ -354,10 +354,10 @@ namespace :db do
354 354 Rake::Task["db:schema:load"].invoke
355 355 end
356 356
357   - desc "Recreate the test database from the current environment's database schema"
  357 + # desc "Recreate the test database from the current environment's database schema"
358 358 task :clone => %w(db:schema:dump db:test:load)
359 359
360   - desc "Recreate the test databases from the development structure"
  360 + # desc "Recreate the test databases from the development structure"
361 361 task :clone_structure => [ "db:structure:dump", "db:test:purge" ] do
362 362 abcs = ActiveRecord::Base.configurations
363 363 case abcs["test"]["adapter"]
@@ -422,7 +422,7 @@ namespace :db do
422 422 end
423 423 end
424 424
425   - desc 'Check for pending migrations and load the test schema'
  425 + # desc 'Check for pending migrations and load the test schema'
426 426 task :prepare => 'db:abort_if_pending_migrations' do
427 427 if defined?(ActiveRecord) && !ActiveRecord::Base.configurations.blank?
428 428 Rake::Task[{ :sql => "db:test:clone_structure", :ruby => "db:test:load" }[ActiveRecord::Base.schema_format]].invoke
@@ -431,7 +431,7 @@ namespace :db do
431 431 end
432 432
433 433 namespace :sessions do
434   - desc "Creates a sessions migration for use with ActiveRecord::SessionStore"
  434 + # desc "Creates a sessions migration for use with ActiveRecord::SessionStore"
435 435 task :create => :environment do
436 436 raise "Task unavailable to this database (no migration support)" unless ActiveRecord::Base.connection.supports_migrations?
437 437 require 'rails/generators'
@@ -440,7 +440,7 @@ namespace :db do
440 440 Rails::Generators::SessionMigrationGenerator.start [ ENV["MIGRATION"] || "add_sessions_table" ]
441 441 end
442 442
443   - desc "Clear the sessions table"
  443 + # desc "Clear the sessions table"
444 444 task :clear => :environment do
445 445 ActiveRecord::Base.connection.execute "DELETE FROM #{session_table_name}"
446 446 end

0 comments on commit fa15111

Marcelo Diniz

Issue #2560 is open with people wondering why some tasks don't show up in rake -T. Would you please drop a line there and possibly close the issue? Thanks!

Please sign in to comment.
Something went wrong with that request. Please try again.