class GeoserverMigrations::Generators::RedoGenerator

Public Instance Methods

rollback_migrations() click to toggle source
# File lib/generators/geoserver_migrations/redo/redo_generator.rb, line 6
def rollback_migrations
  migrator = GeoserverMigrations::Migrator.new
  migrator.migrations_paths = GeoserverMigrations.migrations_rootpath
  # there should not be any pending migrations!
  if migrator.needs_migration?
    puts "There are pending migrations! We can only redo the last migration if there are no pending migrations."
  else
    migrator.rollback
    migrator.migrate
  end
end