Sha256: dbe619c4c63a9d8aad96cbfbd0ad99e6d0919acd5d85042772924f96303b8b80

Contents?: true

Size: 616 Bytes

Versions: 1

Compression:

Stored size: 616 Bytes

Contents

# Used by the audit logging feature
create_table :<%= table_prefix %>_authentication_audit_logs<%= primary_key_type %> do |t|
  t.references :<%= table_prefix %>, foreign_key: true, null: false<%= primary_key_type(:type) %>
  t.datetime :at, null: false, default: <%= current_timestamp %>
  t.text :message, null: false
<% case activerecord_adapter -%>
<% when "postgresql" -%>
  t.jsonb :metadata
<% when "sqlite3", "mysql2" -%>
  t.json :metadata
<% else -%>
  t.string :metadata
<% end -%>
  t.index [:<%= table_prefix %>_id, :at], name: "audit_<%= table_prefix %>_at_idx"
  t.index :at, name: "audit_at_idx"
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
rodauth-rails-1.8.0 lib/generators/rodauth/migration/active_record/audit_logging.erb