Skip to content
Browse files

Remove `rake db:forward` and `rake db:rollback` tasks (refs #9)

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...
1 parent 511ab6d commit 3be18dc555cee8defe44751f3fbb8e7eb0507717 @JonathanTron JonathanTron committed Jan 15, 2013
Showing with 3 additions and 17 deletions.
  1. +3 −0 History.md
  2. +0 −2 README.md
  3. +0 −15 lib/sequel_rails/railties/database.rake
View
3 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)
View
2 README.md
@@ -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
View
15 lib/sequel_rails/railties/database.rake
@@ -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"]
@@ -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')

0 comments on commit 3be18dc

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