[Groonga-commit] ranguba/groonga-client-model at 65d37e0 [master] migration: stop too much forward

Back to archive index

Kouhei Sutou null+****@clear*****
Tue Mar 7 17:06:31 JST 2017


Kouhei Sutou	2017-03-07 17:06:31 +0900 (Tue, 07 Mar 2017)

  New Revision: 65d37e0901d5109cdc3b0d2de95be49c366a4410
  https://github.com/ranguba/groonga-client-model/commit/65d37e0901d5109cdc3b0d2de95be49c366a4410

  Message:
    migration: stop too much forward

  Modified files:
    lib/groonga_client_model/migrator.rb
    lib/groonga_client_model/railties/groonga.rake

  Modified: lib/groonga_client_model/migrator.rb (+1 -0)
===================================================================
--- lib/groonga_client_model/migrator.rb    2017-03-07 17:00:10 +0900 (036368e)
+++ lib/groonga_client_model/migrator.rb    2017-03-07 17:06:31 +0900 (ab7d302)
@@ -29,6 +29,7 @@ module GroongaClientModel
     end
 
     attr_accessor :output
+    attr_reader :current_version
 
     def initialize(search_paths)
       @output = nil

  Modified: lib/groonga_client_model/railties/groonga.rake (+3 -3)
===================================================================
--- lib/groonga_client_model/railties/groonga.rake    2017-03-07 17:00:10 +0900 (5cab18c)
+++ lib/groonga_client_model/railties/groonga.rake    2017-03-07 17:06:31 +0900 (7fdcbfe)
@@ -45,13 +45,13 @@ namespace :groonga do
     task redo: ["setup"] do
       migration_paths = Rails.application.paths["db/groonga/migrate"].to_a
       migrator = GroongaClientModel::Migrator.new(migration_paths)
+      current_version = migrator.current_version
       if ENV["VERSION"]
-        current_version = migrator.current_version
         migrator.target_version = Integer(ENV["VERSION"])
         migrator.migrate
         migrator.target_version = current_version
         migrator.migrate
-      else
+      elsif current_version
         if ENV["STEP"]
           step = Integer(ENV["STEP"])
         else
@@ -59,7 +59,7 @@ namespace :groonga do
         end
         migrator.step = -step
         migrator.migrate
-        migrator.step = step
+        migrator.target_version = current_version
         migrator.migrate
       end
     end
-------------- next part --------------
HTML����������������������������...
Download 



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