Module: Torque::PostgreSQL::Migration::CommandRecorder

Defined in:
lib/torque/postgresql/migration/command_recorder.rb

Instance Method Summary collapse

Instance Method Details

#create_enum(*args, &block) ⇒ Object

Records the creation of the enum to be reverted.



17
18
19
# File 'lib/torque/postgresql/migration/command_recorder.rb', line 17

def create_enum(*args, &block)
  record(:create_enum, args, &block)
end

#invert_create_enum(args) ⇒ Object

Inverts the creation of the enum.



22
23
24
# File 'lib/torque/postgresql/migration/command_recorder.rb', line 22

def invert_create_enum(args)
  [:drop_type, [args.first]]
end

#invert_rename_type(args) ⇒ Object

Inverts the type name.



12
13
14
# File 'lib/torque/postgresql/migration/command_recorder.rb', line 12

def invert_rename_type(args)
  [:rename_type, args.reverse]
end

#rename_type(*args, &block) ⇒ Object

Records the rename operation for types.



7
8
9
# File 'lib/torque/postgresql/migration/command_recorder.rb', line 7

def rename_type(*args, &block)
  record(:rename_type, args, &block)
end