Class: CreateRecorderRevisions

Inherits:
ActiveRecord::Migration
  • Object
show all
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

#changeObject



3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
# File 'lib/generators/recorder/templates/create_recorder_revisions.rb', line 3

def change
  create_table :recorder_revisions do |t|
    t.string :item_type, null: false
    t.integer :item_id, null: false
    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, [:item_type, :item_id]
end