Class: CreateAskAuditLogs

Inherits:
Object
  • Object
show all
Defined in:
lib/generators/ask/install/templates/audit_log_migration.rb

Instance Method Summary collapse

Instance Method Details

#changeObject



4
5
6
7
8
9
10
11
12
13
14
15
# File 'lib/generators/ask/install/templates/audit_log_migration.rb', line 4

def change
  create_table :ask_audit_logs, if_not_exists: true do |t|
    t.string :session_id, null: false
    t.string :event_type, null: false
    t.jsonb :data, default: {}
    t.datetime :timestamp, null: false
    t.timestamps

    t.index [:session_id, :event_type]
    t.index :timestamp
  end
end