Click to toggle contents of `code`
CODE!
#!/bin/sh | |
# BSD 3-Clause License | |
# | |
# Copyright (c) 2017, Péter Szakszon | |
# All rights reserved. | |
# | |
# Redistribution and use in source and binary forms, with or without | |
# modification, are permitted provided that the following conditions are met: | |
# |
CODE!
var Promise = require('bluebird'); | |
var sinon = require('sinon'); | |
var User = require('./db/models').User; | |
describe('User model', function(){ | |
var userFindStub; | |
var sandbox; | |
before(function(){ | |
sandbox = sinon.sandbox.create(); |
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() |