lib/tasks/sequel/undo.rake in umbrellio-sequel-plugins-0.11.0.143 vs lib/tasks/sequel/undo.rake in umbrellio-sequel-plugins-0.12.0

- old
+ new

@@ -1,15 +1,15 @@ # frozen_string_literal: true require "sequel/timestamp_migrator_undo_extension" namespace :sequel do - # Rollback a specific migration + desc "Rollback a specific migration" task undo: :environment do - version = ENV["VERSION"] ? ENV["VERSION"].to_i : nil + version = ENV["VERSION"]&.to_i raise "VERSION is required" unless version - path = ::Rails.root.join("db/migrate") + path = Rails.root.join("db/migrate") migrator = Sequel::TimestampMigrator.new(DB, path, allow_missing_migration_files: true) migrator.undo(version) end end