aboutsummaryrefslogtreecommitdiffstats
path: root/models
diff options
context:
space:
mode:
authorAdam Soltys <[email protected]>2020-01-06 10:32:27 -0800
committerAdam Soltys <[email protected]>2020-01-06 10:34:46 -0800
commit72b9bd0c3785da4338ea233aa3667f138a93d520 (patch)
treecb85c9bc97f0d0dd5dfbbe64b41d06f584d17c8b /models
parent319726f79673d22642536cebbab746ccef0ff2ae (diff)
downloadcoinos-server-72b9bd0c3785da4338ea233aa3667f138a93d520.tar.gz
coinos-server-72b9bd0c3785da4338ea233aa3667f138a93d520.zip
drop sequelize-auto
Diffstat (limited to 'models')
-rw-r--r--models/payments.js123
-rw-r--r--models/users.js303
2 files changed, 426 insertions, 0 deletions
diff --git a/models/payments.js b/models/payments.js
new file mode 100644
index 00000000..8e4f42c7
--- /dev/null
+++ b/models/payments.js
@@ -0,0 +1,123 @@
+const {
+ DataTypes
+} = require('sequelize');
+
+module.exports = sequelize => {
+ const attributes = {
+ id: {
+ type: DataTypes.INTEGER(11),
+ allowNull: false,
+ defaultValue: null,
+ primaryKey: true,
+ autoIncrement: true,
+ comment: null,
+ field: "id"
+ },
+ user_id: {
+ type: DataTypes.INTEGER(11),
+ allowNull: true,
+ defaultValue: null,
+ primaryKey: false,
+ autoIncrement: false,
+ comment: null,
+ field: "user_id"
+ },
+ hash: {
+ type: DataTypes.TEXT,
+ allowNull: true,
+ defaultValue: null,
+ primaryKey: false,
+ autoIncrement: false,
+ comment: null,
+ field: "hash"
+ },
+ createdAt: {
+ type: DataTypes.DATE,
+ allowNull: false,
+ defaultValue: null,
+ primaryKey: false,
+ autoIncrement: false,
+ comment: null,
+ field: "createdAt"
+ },
+ updatedAt: {
+ type: DataTypes.DATE,
+ allowNull: false,
+ defaultValue: null,
+ primaryKey: false,
+ autoIncrement: false,
+ comment: null,
+ field: "updatedAt"
+ },
+ rate: {
+ type: DataTypes.DOUBLE,
+ allowNull: true,
+ defaultValue: null,
+ primaryKey: false,
+ autoIncrement: false,
+ comment: null,
+ field: "rate"
+ },
+ currency: {
+ type: DataTypes.STRING(255),
+ allowNull: true,
+ defaultValue: null,
+ primaryKey: false,
+ autoIncrement: false,
+ comment: null,
+ field: "currency"
+ },
+ address: {
+ type: DataTypes.STRING(255),
+ allowNull: true,
+ defaultValue: null,
+ primaryKey: false,
+ autoIncrement: false,
+ comment: null,
+ field: "address"
+ },
+ received: {
+ type: DataTypes.INTEGER(1),
+ allowNull: true,
+ defaultValue: null,
+ primaryKey: false,
+ autoIncrement: false,
+ comment: null,
+ field: "received"
+ },
+ amount: {
+ type: DataTypes.DOUBLE,
+ allowNull: true,
+ defaultValue: null,
+ primaryKey: false,
+ autoIncrement: false,
+ comment: null,
+ field: "amount"
+ },
+ tip: {
+ type: DataTypes.DOUBLE,
+ allowNull: true,
+ defaultValue: null,
+ primaryKey: false,
+ autoIncrement: false,
+ comment: null,
+ field: "tip"
+ },
+ confirmed: {
+ type: DataTypes.INTEGER(1),
+ allowNull: false,
+ defaultValue: null,
+ primaryKey: false,
+ autoIncrement: false,
+ comment: null,
+ field: "confirmed"
+ }
+ };
+ const options = {
+ tableName: "payments",
+ comment: "",
+ indexes: []
+ };
+ const PaymentsModel = sequelize.define("payments_model", attributes, options);
+ return PaymentsModel;
+};
diff --git a/models/users.js b/models/users.js
new file mode 100644
index 00000000..09ba8660
--- /dev/null
+++ b/models/users.js
@@ -0,0 +1,303 @@
+const {
+ DataTypes
+} = require('sequelize');
+
+module.exports = sequelize => {
+ const attributes = {
+ id: {
+ type: DataTypes.INTEGER(11),
+ allowNull: false,
+ defaultValue: null,
+ primaryKey: true,
+ autoIncrement: true,
+ comment: null,
+ field: "id"
+ },
+ username: {
+ type: DataTypes.STRING(255),
+ allowNull: true,
+ defaultValue: null,
+ primaryKey: false,
+ autoIncrement: false,
+ comment: null,
+ field: "username"
+ },
+ password: {
+ type: DataTypes.STRING(255),
+ allowNull: true,
+ defaultValue: null,
+ primaryKey: false,
+ autoIncrement: false,
+ comment: null,
+ field: "password"
+ },
+ email: {
+ type: DataTypes.STRING(255),
+ allowNull: true,
+ defaultValue: null,
+ primaryKey: false,
+ autoIncrement: false,
+ comment: null,
+ field: "email"
+ },
+ address: {
+ type: DataTypes.STRING(255),
+ allowNull: true,
+ defaultValue: null,
+ primaryKey: false,
+ autoIncrement: false,
+ comment: null,
+ field: "address"
+ },
+ unit: {
+ type: DataTypes.STRING(255),
+ allowNull: true,
+ defaultValue: null,
+ primaryKey: false,
+ autoIncrement: false,
+ comment: null,
+ field: "unit"
+ },
+ symbol: {
+ type: DataTypes.STRING(255),
+ allowNull: true,
+ defaultValue: null,
+ primaryKey: false,
+ autoIncrement: false,
+ comment: null,
+ field: "symbol"
+ },
+ currency: {
+ type: DataTypes.STRING(255),
+ allowNull: false,
+ defaultValue: "CAD",
+ primaryKey: false,
+ autoIncrement: false,
+ comment: null,
+ field: "currency"
+ },
+ commission: {
+ type: DataTypes.STRING(255),
+ allowNull: true,
+ defaultValue: null,
+ primaryKey: false,
+ autoIncrement: false,
+ comment: null,
+ field: "commission"
+ },
+ title: {
+ type: DataTypes.STRING(255),
+ allowNull: true,
+ defaultValue: null,
+ primaryKey: false,
+ autoIncrement: false,
+ comment: null,
+ field: "title"
+ },
+ pubkey: {
+ type: DataTypes.STRING(255),
+ allowNull: true,
+ defaultValue: null,
+ primaryKey: false,
+ autoIncrement: false,
+ comment: null,
+ field: "pubkey"
+ },
+ privkey: {
+ type: DataTypes.STRING(255),
+ allowNull: true,
+ defaultValue: null,
+ primaryKey: false,
+ autoIncrement: false,
+ comment: null,
+ field: "privkey"
+ },
+ createdAt: {
+ type: DataTypes.DATE,
+ allowNull: false,
+ defaultValue: null,
+ primaryKey: false,
+ autoIncrement: false,
+ comment: null,
+ field: "createdAt"
+ },
+ updatedAt: {
+ type: DataTypes.DATE,
+ allowNull: false,
+ defaultValue: null,
+ primaryKey: false,
+ autoIncrement: false,
+ comment: null,
+ field: "updatedAt"
+ },
+ index: {
+ type: DataTypes.INTEGER(11),
+ allowNull: true,
+ defaultValue: null,
+ primaryKey: false,
+ autoIncrement: false,
+ comment: null,
+ field: "index"
+ },
+ balance: {
+ type: DataTypes.INTEGER(11),
+ allowNull: false,
+ defaultValue: "0",
+ primaryKey: false,
+ autoIncrement: false,
+ comment: null,
+ field: "balance"
+ },
+ channel: {
+ type: DataTypes.STRING(255),
+ allowNull: true,
+ defaultValue: null,
+ primaryKey: false,
+ autoIncrement: false,
+ comment: null,
+ field: "channel"
+ },
+ readonlypw: {
+ type: DataTypes.STRING(255),
+ allowNull: true,
+ defaultValue: null,
+ primaryKey: false,
+ autoIncrement: false,
+ comment: null,
+ field: "readonlypw"
+ },
+ limit: {
+ type: DataTypes.INTEGER(11),
+ allowNull: true,
+ defaultValue: "0",
+ primaryKey: false,
+ autoIncrement: false,
+ comment: null,
+ field: "limit"
+ },
+ fbtoken: {
+ type: DataTypes.STRING(255),
+ allowNull: true,
+ defaultValue: null,
+ primaryKey: false,
+ autoIncrement: false,
+ comment: null,
+ field: "fbtoken"
+ },
+ friend: {
+ type: DataTypes.INTEGER(1),
+ allowNull: true,
+ defaultValue: null,
+ primaryKey: false,
+ autoIncrement: false,
+ comment: null,
+ field: "friend"
+ },
+ pending: {
+ type: DataTypes.INTEGER(11),
+ allowNull: true,
+ defaultValue: "0",
+ primaryKey: false,
+ autoIncrement: false,
+ comment: null,
+ field: "pending"
+ },
+ name: {
+ type: DataTypes.STRING(255),
+ allowNull: true,
+ defaultValue: null,
+ primaryKey: false,
+ autoIncrement: false,
+ comment: null,
+ field: "name"
+ },
+ pic: {
+ type: DataTypes.STRING(255),
+ allowNull: true,
+ defaultValue: null,
+ primaryKey: false,
+ autoIncrement: false,
+ comment: null,
+ field: "pic"
+ },
+ emailToken: {
+ type: DataTypes.STRING(255),
+ allowNull: true,
+ defaultValue: null,
+ primaryKey: false,
+ autoIncrement: false,
+ comment: null,
+ field: "emailToken"
+ },
+ phone: {
+ type: DataTypes.STRING(255),
+ allowNull: true,
+ defaultValue: null,
+ primaryKey: false,
+ autoIncrement: false,
+ comment: null,
+ field: "phone"
+ },
+ phoneVerified: {
+ type: DataTypes.INTEGER(1),
+ allowNull: true,
+ defaultValue: null,
+ primaryKey: false,
+ autoIncrement: false,
+ comment: null,
+ field: "phoneVerified"
+ },
+ twofa: {
+ type: DataTypes.INTEGER(1),
+ allowNull: true,
+ defaultValue: null,
+ primaryKey: false,
+ autoIncrement: false,
+ comment: null,
+ field: "twofa"
+ },
+ authyId: {
+ type: DataTypes.STRING(255),
+ allowNull: true,
+ defaultValue: null,
+ primaryKey: false,
+ autoIncrement: false,
+ comment: null,
+ field: "authyId"
+ },
+ pin: {
+ type: DataTypes.STRING(255),
+ allowNull: true,
+ defaultValue: null,
+ primaryKey: false,
+ autoIncrement: false,
+ comment: null,
+ field: "pin"
+ },
+ emailVerified: {
+ type: DataTypes.INTEGER(1),
+ allowNull: true,
+ defaultValue: null,
+ primaryKey: false,
+ autoIncrement: false,
+ comment: null,
+ field: "emailVerified"
+ },
+ phoneToken: {
+ type: DataTypes.STRING(255),
+ allowNull: true,
+ defaultValue: null,
+ primaryKey: false,
+ autoIncrement: false,
+ comment: null,
+ field: "phoneToken"
+ }
+ };
+ const options = {
+ tableName: "users",
+ comment: "",
+ indexes: []
+ };
+ const UsersModel = sequelize.define("users_model", attributes, options);
+ return UsersModel;
+};