aboutsummaryrefslogtreecommitdiffstats
path: root/db.js
diff options
context:
space:
mode:
Diffstat (limited to 'db.js')
-rw-r--r--db.js25
1 files changed, 0 insertions, 25 deletions
diff --git a/db.js b/db.js
deleted file mode 100644
index a76e2957..00000000
--- a/db.js
+++ /dev/null
@@ -1,25 +0,0 @@
-const config = require("./config");
-const Sequelize = require("sequelize");
-const conf = config.dbOptions;
-
-const db = new Sequelize(conf.database, conf.username, conf.password, {
- host: conf.host,
- dialect: conf.dialect,
- logging: false,
- dialectOptions: { multipleStatements: true }
-});
-
-db["User"] = require("./models/users.js")(db);
-db["Payment"] = require("./models/payments.js")(db);
-
-db["User"].hasMany(db["Payment"], {
- as: "payments",
- foreignKey: "user_id"
-});
-
-db["Payment"].belongsTo(db["User"], {
- as: "user",
- foreignKey: "user_id"
-});
-
-module.exports = db;