aboutsummaryrefslogtreecommitdiffstats
path: root/db
diff options
context:
space:
mode:
Diffstat (limited to 'db')
-rw-r--r--db/index.js10
1 files changed, 10 insertions, 0 deletions
diff --git a/db/index.js b/db/index.js
index 9e78da9d..b411a8ef 100644
--- a/db/index.js
+++ b/db/index.js
@@ -17,7 +17,17 @@ db["User"].hasMany(db["Payment"], {
foreignKey: "user_id"
});
+db["User"].hasMany(db["Invoice"], {
+ as: "invoices",
+ foreignKey: "user_id"
+});
+
db["Payment"].belongsTo(db["User"], {
as: "user",
foreignKey: "user_id"
});
+
+db["Invoice"].belongsTo(db["User"], {
+ as: "user",
+ foreignKey: "user_id"
+});