Class: AddObjectChangesToVersions

Inherits:
ActiveRecord::Migration
  • Object
show all
Defined in:
lib/generators/paper_trail/templates/add_object_changes_to_versions.rb

Overview

This migration adds the optional ‘object_changes` column, in which PaperTrail will store the `changes` diff for each update event. See the readme for details.

Constant Summary collapse

TEXT_BYTES =

The largest text column available in all supported RDBMS. See ‘create_versions.rb` for details.

1_073_741_823

Instance Method Summary collapse

Instance Method Details

#changeObject



9
10
11
# File 'lib/generators/paper_trail/templates/add_object_changes_to_versions.rb', line 9

def change
  add_column :versions, :object_changes, :text, limit: TEXT_BYTES
end