From 5662fe79f8834c492665924c68b443dd8432b342 Mon Sep 17 00:00:00 2001 From: Mateusz Kwasniewski Date: Fri, 25 Oct 2024 09:53:52 +0200 Subject: [PATCH] feat: emails sent table migration (#8528) --- .../20241024081537-sent-emails-table.js | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 src/migrations/20241024081537-sent-emails-table.js diff --git a/src/migrations/20241024081537-sent-emails-table.js b/src/migrations/20241024081537-sent-emails-table.js new file mode 100644 index 0000000000..707702e391 --- /dev/null +++ b/src/migrations/20241024081537-sent-emails-table.js @@ -0,0 +1,16 @@ +exports.up = function(db, cb) { + db.runSql(` + CREATE TABLE IF NOT EXISTS emails_sent + ( + id VARCHAR(255) NOT NULL, + type VARCHAR(255) NOT NULL, + created_at TIMESTAMP DEFAULT now(), + payload JSONB NOT NULL DEFAULT '{}'::jsonb, + PRIMARY KEY (id, type) + ); +`, cb) +}; + +exports.down = function(db, cb) { + db.runSql(`DROP TABLE emails_sent;`, cb); +};