Skip to content
On this page

@history

History namespace plugin -- generates history tables and triggers for change tracking. Creates a {table}_history table mirroring the source table's columns plus history metadata (history_id, valid_from, valid_to, history_operation). BEFORE UPDATE/DELETE triggers copy the OLD row into the history table. Postgres: PL/pgSQL function + multi-event BEFORE trigger. MySQL: Separate per-event BEFORE triggers with explicit column enumeration. SQLite: Separate per-event BEFORE triggers with explicit column enumeration.

Postgres Mysql (beta) Sqlite (beta)

Tags

@history

Enable history tracking on this table (creates history table + triggers)

Targets: table

Arguments:

NameTypeRequiredValues
destinationstringNo
onarrayNoupdate, delete

Lint Rules

history.require-history

Tables should have a @history tag

Default severity: warn