Kosuke Asami
null+****@clear*****
Tue Jul 16 15:06:22 JST 2013
Kosuke Asami 2013-07-16 15:06:22 +0900 (Tue, 16 Jul 2013) New Revision: f3daf69f43fc4ea9de67606714b2a480249fda56 https://github.com/groonga/fluent-plugin-droonga/commit/f3daf69f43fc4ea9de67606714b2a480249fda56 Message: column_create: support "name" parameter for index-type column Modified files: lib/droonga/plugin/groonga/column_create.rb test/plugin/groonga/test_column_create.rb Modified: lib/droonga/plugin/groonga/column_create.rb (+11 -1) =================================================================== --- lib/droonga/plugin/groonga/column_create.rb 2013-07-16 15:02:50 +0900 (a9e5d60) +++ lib/droonga/plugin/groonga/column_create.rb 2013-07-16 15:06:22 +0900 (1b3ad6a) @@ -72,7 +72,7 @@ module Droonga target_table = @command["type"] target_column = @command["source"] - options = {} + options = create_index_options Groonga::Schema.define(:context => @context) do |schema| schema.change_table(table_name) do |table| table.index("#{target_table}.#{target_column}", options) @@ -80,6 +80,16 @@ module Droonga end [true] end + + def create_index_options + options = {} + create_column_index_name(options) + options + end + + def create_column_index_name(options) + options[:name] = @command["name"] + end end end end Modified: test/plugin/groonga/test_column_create.rb (+1 -1) =================================================================== --- test/plugin/groonga/test_column_create.rb 2013-07-16 15:02:50 +0900 (3a4e2a7) +++ test/plugin/groonga/test_column_create.rb 2013-07-16 15:06:22 +0900 (ec49bc5) @@ -69,7 +69,7 @@ column_create Books title COLUMN_VECTOR ShortText "WITH_SECTION" => { :flags => "COLUMN_INDEX", :schema => <<-SCHEMA, -column_create Books Books_title COLUMN_INDEX Books title +column_create Books entry_title COLUMN_INDEX Books title SCHEMA }, }) -------------- next part -------------- HTML����������������������������...Download