Kouhei Sutou
null+****@clear*****
Mon Mar 6 12:54:47 JST 2017
Kouhei Sutou 2017-03-06 12:54:47 +0900 (Mon, 06 Mar 2017) New Revision: 20c382ea29d1b8968826a4d21092a0e9b47e766f https://github.com/ranguba/groonga-client-model/commit/20c382ea29d1b8968826a4d21092a0e9b47e766f Message: migration: support float Modified files: lib/groonga_client_model/migration.rb test/unit/migration/test_create_table.rb Modified: lib/groonga_client_model/migration.rb (+4 -0) =================================================================== --- lib/groonga_client_model/migration.rb 2017-03-06 12:53:11 +0900 (14d4a8a) +++ lib/groonga_client_model/migration.rb 2017-03-06 12:54:47 +0900 (35fd700) @@ -340,6 +340,10 @@ module GroongaClientModel @migration.add_column(@table_name, column_name, type, options) end + def float(column_name, options={}) + @migration.add_column(@table_name, column_name, :float, options) + end + def short_text(column_name, options={}) @migration.add_column(@table_name, column_name, :short_text, options) end Modified: test/unit/migration/test_create_table.rb (+8 -0) =================================================================== --- test/unit/migration/test_create_table.rb 2017-03-06 12:53:11 +0900 (749d646) +++ test/unit/migration/test_create_table.rb 2017-03-06 12:54:47 +0900 (dfaee76) @@ -230,6 +230,14 @@ column_create posts #{column_name} COLUMN_SCALAR #{groonga_type} end end + sub_test_case("#float") do + test("default") do + assert_migrate_add_column(:score, "Float") do |table| + table.float(:score) + end + end + end + sub_test_case("#short_text") do test("default") do assert_migrate_add_column(:title, "ShortText") do |table| -------------- next part -------------- HTML����������������������������...Download