2019-05-02 18:17:27 -04:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2017-08-31 00:06:56 -04:00
|
|
|
class RenameVersionColumn < ActiveRecord::Migration[4.2]
|
2013-12-11 21:41:34 -05:00
|
|
|
def change
|
|
|
|
add_column :posts, :version, :integer, default: 1, null: false
|
|
|
|
execute "UPDATE posts SET version = cached_version"
|
|
|
|
remove_column :posts, :cached_version
|
|
|
|
end
|
|
|
|
end
|