aboutsummaryrefslogtreecommitdiffstats
path: root/db.js
diff options
context:
space:
mode:
authorAdam Soltys <[email protected]>2018-03-02 16:46:49 -0800
committerAdam Soltys <[email protected]>2018-03-02 16:46:49 -0800
commitda49c83d765e88fb505bcfc76e6f41763f5ceedd (patch)
tree49898b3bf5f5cef11ab82a32b9a260b75448e95a /db.js
parent9e69c2f3f6ca8c65d9ad1146121b56f5e6194e6e (diff)
downloadcoinos-server-da49c83d765e88fb505bcfc76e6f41763f5ceedd.tar.gz
coinos-server-da49c83d765e88fb505bcfc76e6f41763f5ceedd.zip
authenticate sockets and only emit to specific subscribers
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 = {}