aboutsummaryrefslogtreecommitdiffstats
path: root/db/index.js
diff options
context:
space:
mode:
authorAdam Soltys <[email protected]>2020-04-24 22:46:45 -0700
committerAdam Soltys <[email protected]>2020-04-28 22:33:02 -0700
commitfae6e8b55ea12989d688eb777c002222199c169b (patch)
tree3efed4974408fc1bc8911aa9fb9fc657456d69ee /db/index.js
parent306357c24d3014b55ae1cd25b954a695ea2e5cc6 (diff)
downloadcoinos-server-fae6e8b55ea12989d688eb777c002222199c169b.tar.gz
coinos-server-fae6e8b55ea12989d688eb777c002222199c169b.zip
improved assets support
Diffstat (limited to 'db/index.js')
-rw-r--r--db/index.js10
1 files changed, 10 insertions, 0 deletions
diff --git a/db/index.js b/db/index.js
index bb94fb98..215d34df 100644
--- a/db/index.js
+++ b/db/index.js
@@ -28,6 +28,11 @@ db["User"].hasMany(db["Payment"], {
foreignKey: "user_id"
});
+db["User"].belongsTo(db["Account"], {
+ as: "account",
+ foreignKey: "account_id"
+});
+
db["Account"].belongsTo(db["User"], {
as: "user",
foreignKey: "user_id"
@@ -38,6 +43,11 @@ db["Invoice"].belongsTo(db["User"], {
foreignKey: "user_id"
});
+db["Payment"].belongsTo(db["Account"], {
+ as: "account",
+ foreignKey: "account_id"
+});
+
db["Payment"].belongsTo(db["User"], {
as: "user",
foreignKey: "user_id"