lamassu-server/migrations/1627868356883-customer-custom-notes.js
Sérgio Salgado 01841c03ba fix: missing comma in migration file
fix: default value for customer notes
fix: remove custom requirements divider when there are no requirements set
2021-12-10 18:18:57 +00:00

21 lines
481 B
JavaScript

var db = require('./db')
exports.up = function (next) {
var sql = [
`CREATE TABLE customer_notes (
id UUID PRIMARY KEY,
customer_id UUID NOT NULL REFERENCES customers(id),
created TIMESTAMPTZ NOT NULL DEFAULT now(),
last_edited_at TIMESTAMPTZ,
last_edited_by UUID REFERENCES users(id),
title TEXT NOT NULL DEFAULT '',
content TEXT NOT NULL DEFAULT ''
)`
]
db.multi(sql, next)
}
exports.down = function (next) {
next()
}