Class: CreateFourEyesTables

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

Class Method Summary collapse

Class Method Details

.downObject



22
23
24
# File 'lib/generators/four_eyes/templates/migration.rb', line 22

def self.down
  drop_table :four_eyes_actions
end

.upObject



2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
# File 'lib/generators/four_eyes/templates/migration.rb', line 2

def self.up
  create_table :four_eyes_actions do |t|
    t.string :action_type
    t.string :resource_class_name
    t.integer :maker_resource_id
    t.integer :checker_resource_id
    t.integer :maker_resource_role_id
    t.integer :checker_resource_role_id
    t.string :object_resource_class_name
    t.integer :object_resource_id
    t.json    :data
    t.string :status

    t.timestamps
  end

  add_index :four_eyes_actions, :maker_resource_id
  add_index :four_eyes_actions, :checker_resource_id
end