[Groonga-commit] groonga/heroku-sample-rroonga-blog at 89b2773 [master] Check whether DB initialized

Back to archive index

Kouhei Sutou null+****@clear*****
Sun May 25 16:29:26 JST 2014


Kouhei Sutou	2014-05-25 16:29:26 +0900 (Sun, 25 May 2014)

  New Revision: 89b2773c3394f033726ca976356a1b2fc422877f
  https://github.com/groonga/heroku-sample-rroonga-blog/commit/89b2773c3394f033726ca976356a1b2fc422877f

  Message:
    Check whether DB initialized
    
    `rake db:migrate` isn't run on the first push.Guard DB initialized

  Modified files:
    groonga/init.rb

  Modified: groonga/init.rb (+5 -4)
===================================================================
--- groonga/init.rb    2014-05-25 16:09:03 +0900 (f8ba376)
+++ groonga/init.rb    2014-05-25 16:29:26 +0900 (ca2113e)
@@ -11,10 +11,11 @@ Groonga::Schema.define do |schema|
   end
 end
 
-indexer = PostIndexer.new
-posts = Groonga['Posts']
-Post.all.each do |post|
-  indexer.add(post)
+if Post.table_exists?
+  indexer = PostIndexer.new
+  Post.all.each do |post|
+    indexer.add(post)
+  end
 end
 
 Groonga::Schema.define do |schema|
-------------- next part --------------
HTML����������������������������...
下載 



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