From: Gabriel Ebner Date: Sun, 4 May 2008 10:04:07 +0000 (+0000) Subject: api06: Fix the version-numbers-on-current-tables migration: We want the rows X-Git-Tag: live~7577^2~375 X-Git-Url: https://git.openstreetmap.org/rails.git/commitdiff_plain/9274a6010a03bbccdeb471cea5e0be319bb735c7 api06: Fix the version-numbers-on-current-tables migration: We want the rows in the current table to have the same version number as the latest one in the history table (the latest version is kept in both the current and the history tables.) --- diff --git a/db/migrate/014_move_to_innodb.rb b/db/migrate/014_move_to_innodb.rb index 57065a594..da6442dab 100644 --- a/db/migrate/014_move_to_innodb.rb +++ b/db/migrate/014_move_to_innodb.rb @@ -20,7 +20,7 @@ class MoveToInnodb < ActiveRecord::Migration @@ver_tbl.each { |tbl| add_column "current_#{tbl}", "version", :bigint, :limit => 20, :null => false execute "UPDATE current_#{tbl} SET version = " + - "(SELECT max(version)+1 FROM #{tbl} WHERE #{tbl}.id = current_#{tbl}.id)" + "(SELECT max(version) FROM #{tbl} WHERE #{tbl}.id = current_#{tbl}.id)" } end