Class: Droonga::SchemaApplier

Inherits:
Object
  • Object
show all
Includes:
Loggable
Defined in:
lib/droonga/schema_applier.rb

Instance Method Summary collapse

Constructor Details

#initialize(context, schema) ⇒ SchemaApplier

Returns a new instance of SchemaApplier.



22
23
24
25
# File 'lib/droonga/schema_applier.rb', line 22

def initialize(context, schema)
  @context = context
  @schema = schema
end

Instance Method Details

#applyObject



27
28
29
30
31
32
33
34
# File 'lib/droonga/schema_applier.rb', line 27

def apply
  # TODO: Support migration
  Groonga::Schema.define(:context => @context) do |schema|
    create_tables(schema)
    create_reference_columns(schema)
    create_index_columns(schema)
  end
end