aboutsummaryrefslogtreecommitdiffstats
path: root/db/index.js
diff options
context:
space:
mode:
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"