Sha256: e427b92c7c558262fec86f5dec684ab0406f03465ccd61e678a6040e3e456102

Contents?: true

Size: 488 Bytes

Versions: 1

Compression:

Stored size: 488 Bytes

Contents

module DataMigrations
  class Instruction
    class Remove < Base
      def initialize(migration, *columns)
        super(migration)
        self.options = columns.extract_options!
        self.columns = columns
      end

      def statements
        remove_statements
      end

      protected

        def remove_statements
          columns.map do |column|
            "ALTER TABLE #{source.quoted_name} DROP COLUMN #{column.quoted_name}"
          end
        end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
data_migrations-0.0.1 lib/data_migrations/instruction/remove.rb