aboutsummaryrefslogtreecommitdiffstats
path: root/db.js
diff options
context:
space:
mode:
Diffstat (limited to 'db.js')
-rw-r--r--db.js7
1 files changed, 7 insertions, 0 deletions
diff --git a/db.js b/db.js
index 445df70e..42ba47f9 100644
--- a/db.js
+++ b/db.js
@@ -70,6 +70,13 @@ const p = (lnrpc) => {
db[k] = db.define(k, fields, { tableName: t })
+ if (t === 'invoices') {
+ db['Invoice'].belongsTo(db['User'], {
+ as: 'user',
+ foreignKey: 'user_id'
+ })
+ }
+
let typefields = {}
let options = {}