aboutsummaryrefslogtreecommitdiffstats
path: root/db/normalized
diff options
context:
space:
mode:
authorRan Guin <[email protected]>2021-05-15 16:05:14 -0700
committerAdam Soltys <[email protected]>2021-06-09 16:05:31 -0700
commitaf07126dd3a8ad6201da3632cf880d5e52e814a3 (patch)
tree8ab4ad22c484daf21b86a81eb84eb8b4d0546513 /db/normalized
parentd8ac4e0a59e0c71b27106526024b9e1eb1c0f26d (diff)
downloadcoinos-server-af07126dd3a8ad6201da3632cf880d5e52e814a3.tar.gz
coinos-server-af07126dd3a8ad6201da3632cf880d5e52e814a3.zip
add token field to referrals
Diffstat (limited to 'db/normalized')
-rw-r--r--db/normalized/referrals.js11
1 files changed, 7 insertions, 4 deletions
diff --git a/db/normalized/referrals.js b/db/normalized/referrals.js
index 2458ef19..17266225 100644
--- a/db/normalized/referrals.js
+++ b/db/normalized/referrals.js
@@ -1,5 +1,4 @@
-const Sequelize = require('sequelize');
-const { DataTypes } = Sequelize;
+const { DataTypes } = require('sequelize');
const attributes = {
id: {
@@ -14,6 +13,11 @@ const attributes = {
allowNull: false,
comment: "Referral made by this user"
},
+ token: {
+ type: DataTypes.STRING(255),
+ allowNull: false,
+ comment: "Unique referral token"
+ },
user_id: {
type: DataTypes.INTEGER(11),
references: { model: db.User, key: 'id' },
@@ -21,7 +25,7 @@ const attributes = {
comment: "Referral granted to this user (updated when token used)"
},
expiry: {
- type: Sequelize.DATE
+ type: DataTypes.DATE
},
status: {
type: DataTypes.ENUM,
@@ -30,7 +34,6 @@ const attributes = {
}
}
-
const options = {
tableName: "referrals",
comment: "Referrals - unique record for each sponsor / user_id",