chore: use monorepo organization

This commit is contained in:
Rafael Taranto 2025-05-12 10:52:54 +01:00
parent deaf7d6ecc
commit a687827f7e
1099 changed files with 8184 additions and 11535 deletions

View file

@ -0,0 +1,38 @@
var db = require('./db')
const singleQuotify = (item) => `'${item}'`
var types = [
'highValueTransaction',
'transaction',
'fiatBalance',
'cryptoBalance',
'compliance',
'error'
]
.map(singleQuotify)
.join(',')
exports.up = function (next) {
const sql = [
`
CREATE TYPE notification_type AS ENUM ${'(' + types + ')'};
CREATE TABLE "notifications" (
"id" uuid NOT NULL PRIMARY KEY,
"type" notification_type NOT NULL,
"detail" JSONB,
"message" TEXT NOT NULL,
"created" TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT CURRENT_TIMESTAMP,
"read" BOOLEAN NOT NULL DEFAULT 'false',
"valid" BOOLEAN NOT NULL DEFAULT 'true'
);
CREATE INDEX ON notifications (valid);
CREATE INDEX ON notifications (read);`
]
db.multi(sql, next)
}
exports.down = function (next) {
next()
}