diff --git a/History.md b/History.md index 2c0077c..1e23dd7 100644 --- a/History.md +++ b/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) diff --git a/README.md b/README.md index 839dedc..ffa0480 100644 --- a/README.md +++ b/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 diff --git a/lib/sequel_rails/railties/database.rake b/lib/sequel_rails/railties/database.rake index 913abc3..ad7b8bc 100644 --- a/lib/sequel_rails/railties/database.rake +++ b/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')