Module: Torque::PostgreSQL::Migration::CommandRecorder
- Defined in:
- lib/torque/postgresql/migration/command_recorder.rb
Instance Method Summary collapse
-
#create_enum(*args, &block) ⇒ Object
Records the creation of the enum to be reverted.
-
#invert_create_enum(args) ⇒ Object
Inverts the creation of the enum.
-
#invert_rename_type(args) ⇒ Object
Inverts the type name.
-
#rename_type(*args, &block) ⇒ Object
Records the rename operation for types.
Instance Method Details
#create_enum(*args, &block) ⇒ Object
Records the creation of the enum to be reverted.
19 20 21 |
# File 'lib/torque/postgresql/migration/command_recorder.rb', line 19 def create_enum(*args, &block) record(:create_enum, args, &block) end |
#invert_create_enum(args) ⇒ Object
Inverts the creation of the enum.
24 25 26 |
# File 'lib/torque/postgresql/migration/command_recorder.rb', line 24 def invert_create_enum(args) [:drop_type, [args.first]] end |
#invert_rename_type(args) ⇒ Object
Inverts the type name.
14 15 16 |
# File 'lib/torque/postgresql/migration/command_recorder.rb', line 14 def invert_rename_type(args) [:rename_type, args.reverse] end |
#rename_type(*args, &block) ⇒ Object
Records the rename operation for types.
9 10 11 |
# File 'lib/torque/postgresql/migration/command_recorder.rb', line 9 def rename_type(*args, &block) record(:rename_type, args, &block) end |