Method: CassandraMigrations::Migration::TableOperations#alter_table

Defined in:
lib/cassandra_migrations/migration/table_operations.rb

#alter_table(table_name, options = {}) {|table_definition| ... } ⇒ Object

Yields:

  • (table_definition)


39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
# File 'lib/cassandra_migrations/migration/table_operations.rb', line 39

def alter_table(table_name, options={})
  table_definition = TableDefinition.new
  table_definition.define_options(options[:options]) if options[:options]

  yield table_definition if block_given?

  announce_operation "alter_table #{table_name}"

  create_cql =  "ALTER TABLE #{table_name}"
  create_cql << table_definition.options

  announce_suboperation create_cql

  execute create_cql
end