AuditLog.Migration (AuditLog v0.1.0)

Copy Markdown View Source

Installs and removes the PostgreSQL objects used by AuditLog.

:prefix defaults to the active Ecto migration prefix. Without one, the database's current search path is used. A supplied prefix must already exist and match [a-z_][a-z0-9_]*.

Summary

Functions

Drops the event table and trigger function.

Creates the audit_events table, timeline indexes, and append-only trigger.

Functions

down(opts \\ [])

@spec down(keyword()) :: :ok

Drops the event table and trigger function.

This permanently removes every recorded event in the selected prefix.

up(opts \\ [])

@spec up(keyword()) :: :ok

Creates the audit_events table, timeline indexes, and append-only trigger.

Pass prefix: :audit to install the objects in an existing PostgreSQL schema.