Sha256: 2167946064e7ee0533f4945c17af2c06655e35acac323cfe0e232c7a46653a0f

Contents?: true

Size: 466 Bytes

Versions: 5

Compression:

Stored size: 466 Bytes

Contents

# frozen_string_literal: true

class Cleanup < ActiveRecord::Migration[4.2]
  # Remove obsolete tables and columns that may have been left behind by other migrations.
  def self.up
    if ActiveRecord::Base.connection.columns("venues").map(&:name).include?("version")
      remove_column :venues, :version
    end

    %w[event_versions venue_versions].each do |table|
      drop_table table if ActiveRecord::Base.connection.tables.include?(table)
    end
  end
end

Version data entries

5 entries across 5 versions & 2 rubygems

Version Path
koalagator-3.0.0 db/migrate/20120709092821_cleanup.rb
koalagator-2.1.1 db/migrate/20120709092821_cleanup.rb
koalagator-2.1.0 db/migrate/20120709092821_cleanup.rb
calagator2-2.1.1 db/migrate/20120709092821_cleanup.rb
calagator2-2.1.0 db/migrate/20120709092821_cleanup.rb