Sha256: 08e6f22ab8f87855fbd61c65643ebee3cb403b9cc1cfd53d68bed5f88c39aa9d

Contents?: true

Size: 741 Bytes

Versions: 39

Compression:

Stored size: 741 Bytes

Contents

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

39 entries across 39 versions & 1 rubygems

Version Path
torque-postgresql-1.1.8 lib/torque/postgresql/migration/command_recorder.rb
torque-postgresql-1.1.7 lib/torque/postgresql/migration/command_recorder.rb
torque-postgresql-2.0.3 lib/torque/postgresql/migration/command_recorder.rb
torque-postgresql-2.0.2 lib/torque/postgresql/migration/command_recorder.rb
torque-postgresql-1.1.6 lib/torque/postgresql/migration/command_recorder.rb
torque-postgresql-1.1.5 lib/torque/postgresql/migration/command_recorder.rb
torque-postgresql-2.0.1 lib/torque/postgresql/migration/command_recorder.rb
torque-postgresql-2.0.0 lib/torque/postgresql/migration/command_recorder.rb
torque-postgresql-1.1.4 lib/torque/postgresql/migration/command_recorder.rb
torque-postgresql-1.1.3 lib/torque/postgresql/migration/command_recorder.rb
torque-postgresql-1.1.2 lib/torque/postgresql/migration/command_recorder.rb
torque-postgresql-1.1.1 lib/torque/postgresql/migration/command_recorder.rb
torque-postgresql-1.1.0 lib/torque/postgresql/migration/command_recorder.rb
torque-postgresql-1.0.1 lib/torque/postgresql/migration/command_recorder.rb
torque-postgresql-1.0.0 lib/torque/postgresql/migration/command_recorder.rb
torque-postgresql-0.2.16 lib/torque/postgresql/migration/command_recorder.rb
torque-postgresql-0.2.15 lib/torque/postgresql/migration/command_recorder.rb
torque-postgresql-0.2.14 lib/torque/postgresql/migration/command_recorder.rb
torque-postgresql-0.2.13 lib/torque/postgresql/migration/command_recorder.rb
torque-postgresql-0.2.12 lib/torque/postgresql/migration/command_recorder.rb