Sha256: 6a9cbca44d04ef06b90e3c4c4fcd88b2f277766a4058894a899fd16282b875bf

Contents?: true

Size: 772 Bytes

Versions: 14

Compression:

Stored size: 772 Bytes

Contents

# frozen_string_literal: true

module Torque
  module PostgreSQL
    module Migration
      module CommandRecorder

        # Records the rename operation for types.
        def rename_type(*args, &block)
          record(:rename_type, args, &block)
        end

        # Inverts the type name.
        def invert_rename_type(args)
          [:rename_type, args.reverse]
        end

        # Records the creation of the enum to be reverted.
        def create_enum(*args, &block)
          record(:create_enum, args, &block)
        end

        # Inverts the creation of the enum.
        def invert_create_enum(args)
          [:drop_type, [args.first]]
        end

      end

      ActiveRecord::Migration::CommandRecorder.include CommandRecorder
    end
  end
end

Version data entries

14 entries across 14 versions & 1 rubygems

Version Path
torque-postgresql-3.0.1 lib/torque/postgresql/migration/command_recorder.rb
torque-postgresql-2.2.4 lib/torque/postgresql/migration/command_recorder.rb
torque-postgresql-3.0.0 lib/torque/postgresql/migration/command_recorder.rb
torque-postgresql-2.2.3 lib/torque/postgresql/migration/command_recorder.rb
torque-postgresql-2.2.2 lib/torque/postgresql/migration/command_recorder.rb
torque-postgresql-2.2.1 lib/torque/postgresql/migration/command_recorder.rb
torque-postgresql-2.2.0 lib/torque/postgresql/migration/command_recorder.rb
torque-postgresql-2.1.3 lib/torque/postgresql/migration/command_recorder.rb
torque-postgresql-2.1.2 lib/torque/postgresql/migration/command_recorder.rb
torque-postgresql-2.1.1 lib/torque/postgresql/migration/command_recorder.rb
torque-postgresql-2.1.0 lib/torque/postgresql/migration/command_recorder.rb
torque-postgresql-2.0.6 lib/torque/postgresql/migration/command_recorder.rb
torque-postgresql-2.0.5 lib/torque/postgresql/migration/command_recorder.rb
torque-postgresql-2.0.4 lib/torque/postgresql/migration/command_recorder.rb