Method: SchemaRD::MigrationContext::Loader#create_table

Defined in:
lib/schemard/schema_parser.rb

#create_table(table_name, options = {}) {|TableDefinition.new(table, with_comment: @parse_db_comment)| ... } ⇒ Object

Yields:



57
58
59
60
61
62
63
64
# File 'lib/schemard/schema_parser.rb', line 57

def create_table(table_name, options = {})
  if options[:comment] && @parse_db_comment
    options[:parsed_db_comment] = options.delete(:comment)
  end
  table = SchemaRD::Table.new(options.merge(name: table_name))
  @schema.add_table(table_name, table)
  yield TableDefinition.new(table, with_comment: @parse_db_comment)
end