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-24 22:46:45 -0700
commit83f973224bad381df62774bcc058f76eab635f0c (patch)
treeef231f4490b0c9d194b8683be50c05524738903e /db/index.js
parent306357c24d3014b55ae1cd25b954a695ea2e5cc6 (diff)
downloadcoinos-server-assets.tar.gz
coinos-server-assets.zip
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"