Class: CreateRecorderRevisions
- Inherits:
-
ActiveRecord::Migration
- Object
- ActiveRecord::Migration
- CreateRecorderRevisions
- Defined in:
- lib/generators/recorder/templates/create_recorder_revisions.rb
Overview
This migration creates the ‘recorder_revisions` table.
Instance Method Summary collapse
Instance Method Details
#change ⇒ Object
5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 |
# File 'lib/generators/recorder/templates/create_recorder_revisions.rb', line 5 def change create_table :recorder_revisions do |t| t.string :item_type, null: false t.integer :item_id t.string :event, null: false t.jsonb :data, null: false t.inet :ip t.date :action_date, null: false t.integer :user_id t.jsonb :meta t.datetime :created_at, null: false end add_index :recorder_revisions, %i[item_type item_id] end |