Skip to content

Commit

Permalink
Remove rake db:forward and rake db:rollback tasks (refs #9)
Browse files Browse the repository at this point in the history
Those tasks makes not much sense in the case of TimeStampMigrator
migrations (used by this gem generator). For more information see:
https://groups.google.com/forum/?fromgroups=#!topic/sequel-talk/eXKNhxrhdBw
  • Loading branch information
JonathanTron committed Jan 15, 2013
1 parent 511ab6d commit 3be18dc
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 17 deletions.
3 changes: 3 additions & 0 deletions History.md
@@ -1,6 +1,9 @@
0.4.0.pre2
==========

* Remove `rake db:forward` and `rake db:rollback` as it makes not much sense
when using the TimeStampMigration which is how this gem generates migrations
* Ensure rake tasks returns appropriate code on errors
* Ensure PostgreSQL adapter passes the right options to both create and drop
database (Sascha Cunz)

Expand Down
2 changes: 0 additions & 2 deletions README.md
Expand Up @@ -66,14 +66,12 @@ rake db:create:all # Create all the local databases defined i
rake db:drop[env] # Create the database defined in config/database.yml for the current Rails.env
rake db:drop:all # Drops all the local databases defined in config/database.yml
rake db:force_close_open_connections # Forcibly close any open connections to the test database
rake db:forward # Pushes the schema to the next version. Specify the number of steps with STEP=n
rake db:migrate # Migrate the database to the latest version
rake db:migrate:down # Runs the "down" for a given migration VERSION.
rake db:migrate:redo # Rollbacks the database one migration and re migrate up.
rake db:migrate:reset # Resets your database using your migrations for the current environment
rake db:migrate:up # Runs the "up" for a given migration VERSION.
rake db:reset # Drops and recreates the database from db/schema.rb for the current environment and loads the seeds.
rake db:rollback # 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.
rake db:schema:dump # Create a db/schema.rb file that can be portably used against any DB supported by Sequel
rake db:schema:load # Load a schema.rb file into the database
rake db:seed # Load the seed data from db/seeds.rb
Expand Down
15 changes: 0 additions & 15 deletions lib/sequel_rails/railties/database.rake
Expand Up @@ -93,7 +93,6 @@ namespace :db do
end
end


desc 'Resets your database using your migrations for the current environment'
task :reset => ["db:drop", "db:create", "db:migrate"]

Expand All @@ -120,20 +119,6 @@ namespace :db do
Rake::Task["db:schema:dump"].invoke unless Rails.env.test?
end

desc 'Rolls the schema back to the previous version. Specify the number of steps with STEP=n'
task :rollback => "migrate:load" do
step = ENV['STEP'] ? ENV['STEP'].to_i : 1
Sequel::Migrator.rollback('db/migrate/', step)
Rake::Task["db:schema:dump"].invoke unless Rails.env.test?
end

desc 'Pushes the schema to the next version. Specify the number of steps with STEP=n'
task :forward => "migrate:load" do
step = ENV['STEP'] ? ENV['STEP'].to_i : 1
Sequel::Migrator.forward('db/migrate/', step)
Rake::Task["db:schema:dump"].invoke unless Rails.env.test?
end

desc 'Load the seed data from db/seeds.rb'
task :seed => :abort_if_pending_migrations do
seed_file = File.join(Rails.root, 'db', 'seeds.rb')
Expand Down

0 comments on commit 3be18dc

Please sign in to comment.