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.)
This commit is contained in:
parent
bcbf417796
commit
9274a6010a
1 changed files with 1 additions and 1 deletions
|
@ -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
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue