[Groonga-commit] groonga/fluent-plugin-droonga [master] Add missing value column

Back to archive index

Kouhei Sutou null+****@clear*****
Thu Apr 4 16:59:07 JST 2013


Kouhei Sutou	2013-04-04 16:59:07 +0900 (Thu, 04 Apr 2013)

  New Revision: 482111e00b049dcc0b1734a8a1b19d7fbac4a5c1
  https://github.com/groonga/fluent-plugin-droonga/commit/482111e00b049dcc0b1734a8a1b19d7fbac4a5c1

  Message:
    Add missing value column
    
    It stores requests.

  Added files:
    test/test_job_queue_schema.rb
  Modified files:
    lib/droonga/job_queue_schema.rb

  Modified: lib/droonga/job_queue_schema.rb (+2 -1)
===================================================================
--- lib/droonga/job_queue_schema.rb    2013-04-04 16:49:30 +0900 (dd28dc4)
+++ lib/droonga/job_queue_schema.rb    2013-04-04 16:59:07 +0900 (f9bcbb3)
@@ -45,7 +45,8 @@ module Droonga
       create_context do |context|
         context.open_database(@database_path) do
           Groonga::Schema.define(:context => context) do |schema|
-            schema.create_table(@queue_name, :type => :array) do
+            schema.create_table(@queue_name, :type => :array) do |table|
+              table.text("value")
             end
           end
         end

  Added: test/test_job_queue_schema.rb (+45 -0) 100644
===================================================================
--- /dev/null
+++ test/test_job_queue_schema.rb    2013-04-04 16:59:07 +0900 (e86da48)
@@ -0,0 +1,45 @@
+# Copyright (C) 2013 droonga project
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License version 2.1 as published by the Free Software Foundation.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+
+require "helper"
+
+require "droonga/job_queue_schema"
+
+class JobQueueSchemaTest < Test::Unit::TestCase
+  def setup
+    @database_path = @temporary_directory + "droonga/db"
+    @queue_name = "DroongaQueue"
+  end
+
+  def test_ensure_created
+    schema = Droonga::JobQueueSchema.new(@database_path.to_s, @queue_name)
+
+    assert_not_predicate(@database_path, :exist?)
+    schema.ensure_created
+    assert_predicate(@database_path, :exist?)
+
+    context = Groonga::Context.new
+    dumped_commands = nil
+    context.open_database(@database_path.to_s) do |database|
+      dumped_commands = Groonga::DatabaseDumper.dump(:context => context,
+                                                     :database => database)
+    end
+    context.close
+    assert_equal(<<-SCHEMA, dumped_commands)
+table_create #{@queue_name} TABLE_NO_KEY
+column_create #{@queue_name} value COLUMN_SCALAR Text
+SCHEMA
+  end
+end
-------------- next part --------------
HTML����������������������������...
Download 



More information about the Groonga-commit mailing list
Back to archive index