Installs and removes the PostgreSQL objects used by AuditLog.
:prefix defaults to the active Ecto migration prefix. If the migration has
no prefix, PostgreSQL resolves object names through the current search path.
A supplied prefix must already exist and match [a-z_][a-z0-9_]*.
Summary
Functions
Returns the rendered SQL for tests and migration inspection.
Returns the executable SQL statements for tests and migration inspection.
Drops the event table and trigger function.
Creates the audit_events table, timeline indexes, and append-only trigger.
Types
Functions
Returns the rendered SQL for tests and migration inspection.
Code outside an active Ecto migration must pass prefix: nil explicitly
when it wants PostgreSQL to resolve names through the search path. Unlike
up/1 and down/1, this function never reads the active migration prefix.
Returns the executable SQL statements for tests and migration inspection.
Prefix handling is identical to __sql__/2.
@spec down(keyword()) :: :ok
Drops the event table and trigger function.
This permanently removes every recorded event in the selected prefix.
@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.