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
############################################################################### | |
# Helpful Docker commands and code snippets | |
############################################################################### | |
### CONTAINERS ### | |
docker stop $(docker ps -a -q) #stop ALL containers | |
docker rm -f $(docker ps -a -q) # remove ALL containers | |
docker rm -f $(sudo docker ps --before="container_id_here" -q) # can also filter | |
# exec into container |
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
CREATE TABLE audit_log ( | |
username text, -- who did the change | |
event_time_utc timestamp, -- when the event was recorded | |
table_name text, -- contains schema-qualified table name | |
operation text, -- INSERT, UPDATE, DELETE or TRUNCATE | |
before_value json, -- the OLD tuple value | |
after_value json -- the NEW tuple value | |
); | |
CREATE OR REPLACE FUNCTION audit_trigger() |