aboutsummaryrefslogtreecommitdiffstats
path: root/db/normalized/referrals.js
diff options
context:
space:
mode:
authorAdam Soltys <[email protected]>2021-05-13 19:07:43 -0400
committerAdam Soltys <[email protected]>2021-06-04 22:38:18 -0700
commitfd758f1afb5f8b18b41a2f924382f0e159bc34be (patch)
treecf1bf8fdf18c258d89ced92801a66b4366231a5f /db/normalized/referrals.js
parent793845b3b94b3dd85ebda980b3a81e09613649d7 (diff)
downloadcoinos-server-fd758f1afb5f8b18b41a2f924382f0e159bc34be.tar.gz
coinos-server-fd758f1afb5f8b18b41a2f924382f0e159bc34be.zip
fixups for dev
Diffstat (limited to 'db/normalized/referrals.js')
-rw-r--r--db/normalized/referrals.js13
1 files changed, 5 insertions, 8 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
+// })