aboutsummaryrefslogtreecommitdiffstats
path: root/db
diff options
context:
space:
mode:
Diffstat (limited to 'db')
-rw-r--r--db/normalized/referrals.js13
-rw-r--r--db/normalized/waiting_list.js4
2 files changed, 5 insertions, 12 deletions
diff --git a/db/normalized/referrals.js b/db/normalized/referrals.js
index 5b93ba3f..2458ef19 100644
--- a/db/normalized/referrals.js
+++ b/db/normalized/referrals.js
@@ -1,8 +1,5 @@
-const { DataTypes } = require('sequelize/types');
-const config = require('./../config')
-const dbc = require('knex')(config.knex)
-
-const { DataTypes } = require('sequelize');
+const Sequelize = require('sequelize');
+const { DataTypes } = Sequelize;
const attributes = {
id: {
@@ -13,13 +10,13 @@ const attributes = {
},
sponsor_id: {
type: DataTypes.INTEGER(11),
- references: { model: User, key: 'id' },
+ references: { model: db.User, key: 'id' },
allowNull: false,
comment: "Referral made by this user"
},
user_id: {
type: DataTypes.INTEGER(11),
- references: { model: User, key: 'id' },
+ references: { model: db.User, key: 'id' },
allowNull: true,
comment: "Referral granted to this user (updated when token used)"
},
@@ -73,4 +70,4 @@ db["Referral"] = db.define("referrals_model", attributes, options);
// table.dateTime('created_at').notNullable().defaultTo(knex.raw('CURRENT_TIMESTAMP'))
// table.dateTime('updated_at').notNullable().defaultTo(knex.raw('CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP'))
-// }) \ No newline at end of file
+// })
diff --git a/db/normalized/waiting_list.js b/db/normalized/waiting_list.js
index c849f34f..8803066b 100644
--- a/db/normalized/waiting_list.js
+++ b/db/normalized/waiting_list.js
@@ -1,7 +1,3 @@
-const { DataTypes } = require('sequelize/types');
-const config = require('./../config')
-const dbc = require('knex')(config.knex)
-
const { DataTypes } = require('sequelize');
const attributes = {