This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| -- Step 1: Create the audit logs table | |
| CREATE TABLE audit_logs ( | |
| id SERIAL PRIMARY KEY, | |
| table_name TEXT NOT NULL, | |
| operation TEXT NOT NULL, | |
| json_diff JSONB, | |
| inserted_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP | |
| ); | |
| -- Step 2: Create the trigger function |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| FROM postgres:18-alpine | |
| LABEL maintainer="Jordan Gould <jordangould@gmail.com>" | |
| # Based on https://github.com/andreaswachowski/docker-postgres/blob/master/initdb.sh | |
| # pg_jobmon 1.5.0 | |
| # They never cut a release for 1.5.0 (https://github.com/omniti-labs/pg_jobmon/commit/b9d49e6d4603f2670b3a2d512c31fc7cd5e9a334) | |
| ENV PG_JOBMON_VERSION=b9d49e6d4603f2670b3a2d512c31fc7cd5e9a334 | |
| ENV PG_PARTMAN_VERSION=v5.3.1 | |
| # Install pg_jobmon |