class SquasherClean < ActiveRecord::Migration
  class SchemaMigration < ActiveRecord::Base
  end

  def up
    migrations = Dir.glob(File.join(File.dirname(__FILE__), '**.rb'))
    versions = migrations.map { |file| file.split('/').last[/\A\d+/] }
    SchemaMigration.where("version NOT IN (?)", versions).delete_all
  end

  def down
  end
end

class SquasherClean < ActiveRecord::Migration
  class SchemaMigration < ActiveRecord::Base
  end

  def up
    migrations = Dir.glob(File.join(File.dirname(__FILE__), '*.rb'))
    versions = migrations.map { |file| File.basename(file)[/\A\d+/] }
    SchemaMigration.where("version NOT IN (?)", versions).delete_all
  end

  def down
  end
end

Use a platform-agnostic means for extracting the file name from a path and fix a typo
Use a platform-agnostic means for extracting the file name from a path and fix a typo
