aboutsummaryrefslogtreecommitdiffstats
path: root/db/models
diff options
context:
space:
mode:
Diffstat (limited to 'db/models')
-rw-r--r--db/models/accounts.js217
-rw-r--r--db/models/codes.js32
-rw-r--r--db/models/deposits.js76
-rw-r--r--db/models/invoices.js202
-rw-r--r--db/models/keys.js40
-rw-r--r--db/models/orders.js112
-rw-r--r--db/models/payments.js220
-rw-r--r--db/models/referrals.js90
-rw-r--r--db/models/requests.js67
-rw-r--r--db/models/users.js270
-rw-r--r--db/models/waiting_list.js45
-rw-r--r--db/models/withdrawals.js103
12 files changed, 0 insertions, 1474 deletions
diff --git a/db/models/accounts.js b/db/models/accounts.js
deleted file mode 100644
index 9485bc99..00000000
--- a/db/models/accounts.js
+++ /dev/null
@@ -1,217 +0,0 @@
-import db from "$db/db";
-import { DataTypes } from '@sequelize/core';
-
-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"
- },
- 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"
- },
- path: {
- type: DataTypes.STRING(255),
- allowNull: true,
- defaultValue: null,
- primaryKey: false,
- autoIncrement: false,
- comment: null,
- field: "path"
- },
- seed: {
- type: DataTypes.STRING(255),
- allowNull: true,
- defaultValue: null,
- primaryKey: false,
- autoIncrement: false,
- comment: null,
- field: "seed"
- },
- network: {
- type: DataTypes.STRING(255),
- allowNull: true,
- defaultValue: null,
- primaryKey: false,
- autoIncrement: false,
- comment: null,
- field: "network"
- },
- name: {
- type: DataTypes.STRING(255),
- allowNull: true,
- defaultValue: null,
- primaryKey: false,
- autoIncrement: false,
- comment: null,
- field: "name"
- },
- contract: {
- type: DataTypes.TEXT,
- get: function() {
- return JSON.parse(this.getDataValue("contract"));
- },
- set: function(value) {
- return this.setDataValue("contract", JSON.stringify(value));
- },
- allowNull: true,
- defaultValue: null,
- primaryKey: false,
- autoIncrement: false,
- comment: null,
- field: "contract"
- },
- domain: {
- type: DataTypes.STRING(255),
- allowNull: true,
- defaultValue: null,
- primaryKey: false,
- autoIncrement: false,
- comment: null,
- field: "domain"
- },
- ticker: {
- type: DataTypes.STRING(255),
- allowNull: true,
- defaultValue: null,
- primaryKey: false,
- autoIncrement: false,
- comment: null,
- field: "ticker"
- },
- asset: {
- type: DataTypes.STRING(255),
- allowNull: true,
- defaultValue: null,
- primaryKey: false,
- autoIncrement: false,
- comment: null,
- field: "asset"
- },
- balance: {
- type: DataTypes.DOUBLE,
- allowNull: true,
- defaultValue: null,
- primaryKey: false,
- autoIncrement: false,
- comment: null,
- field: "balance"
- },
- btc_credits: {
- type: DataTypes.DOUBLE,
- allowNull: true,
- defaultValue: 0.0,
- primaryKey: false,
- autoIncrement: false,
- comment: "Credits that can be used towards paying Bitcoin withdrawal fees",
- field: "btc_credits"
- },
- liquid_credits: {
- type: DataTypes.DOUBLE,
- allowNull: true,
- defaultValue: 0.0,
- primaryKey: false,
- autoIncrement: false,
- comment: "Credits that can be used towards paying Liquid withdrawal fees",
- field: "liquid_credits"
- },
- lightning_credits: {
- type: DataTypes.DOUBLE,
- allowNull: true,
- defaultValue: 0.0,
- primaryKey: false,
- autoIncrement: false,
- comment: "Credits that can be used towards paying Lightning withdrawal fees",
- field: "lightning_credits"
- },
- pending: {
- type: DataTypes.DOUBLE,
- allowNull: true,
- defaultValue: null,
- primaryKey: false,
- autoIncrement: false,
- comment: null,
- field: "pending"
- },
- hide: {
- type: DataTypes.BOOLEAN,
- allowNull: true,
- defaultValue: null,
- primaryKey: false,
- autoIncrement: false,
- comment: null,
- field: "hide"
- },
- index: {
- type: DataTypes.INTEGER(11),
- allowNull: false,
- defaultValue: 0,
- primaryKey: false,
- autoIncrement: false,
- comment: null,
- field: "index"
- },
- privkey: {
- type: DataTypes.STRING,
- allowNull: true,
- defaultValue: null,
- primaryKey: false,
- autoIncrement: false,
- comment: null,
- field: "privkey"
- },
- pubkey: {
- type: DataTypes.STRING,
- allowNull: true,
- defaultValue: null,
- primaryKey: false,
- autoIncrement: false,
- comment: null,
- field: "pubkey"
- },
- precision: {
- type: DataTypes.INTEGER(11),
- allowNull: true,
- defaultValue: null,
- primaryKey: false,
- autoIncrement: false,
- comment: null,
- field: "precision"
- },
-};
-
-const options = {
- tableName: "accounts",
- comment: "",
- indexes: []
-};
-
-db["Account"] = db.define("accounts_model", attributes, options);
diff --git a/db/models/codes.js b/db/models/codes.js
deleted file mode 100644
index 0981ac5e..00000000
--- a/db/models/codes.js
+++ /dev/null
@@ -1,32 +0,0 @@
-import db from "$db/db";
-import { DataTypes } from '@sequelize/core';
-
-const attributes = {
- code: {
- type: DataTypes.STRING(255),
- allowNull: false,
- defaultValue: null,
- primaryKey: true,
- autoIncrement: false,
- comment: null,
- field: "code"
- },
- text: {
- type: DataTypes.TEXT,
- allowNull: true,
- defaultValue: null,
- primaryKey: false,
- autoIncrement: false,
- comment: null,
- field: "text"
- },
-};
-
-const options = {
- tableName: "codes",
- comment: "",
- indexes: [],
- timestamps: false
-};
-
-db["Code"] = db.define("codes_model", attributes, options);
diff --git a/db/models/deposits.js b/db/models/deposits.js
deleted file mode 100644
index c486f468..00000000
--- a/db/models/deposits.js
+++ /dev/null
@@ -1,76 +0,0 @@
-import db from "$db/db";
-import { DataTypes } from '@sequelize/core';
-
-const attributes = {
- id: {
- type: DataTypes.INTEGER(11),
- allowNull: false,
- defaultValue: null,
- primaryKey: true,
- autoIncrement: true,
- comment: null,
- field: "id"
- },
- amount: {
- type: DataTypes.DOUBLE,
- allowNull: true,
- defaultValue: null,
- primaryKey: false,
- autoIncrement: false,
- comment: null,
- field: "amount"
- },
- user_id: {
- type: DataTypes.INTEGER(11),
- allowNull: true,
- defaultValue: null,
- primaryKey: false,
- autoIncrement: false,
- comment: null,
- field: "user_id"
- },
- 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"
- },
- credited: {
- type: DataTypes.BOOLEAN,
- allowNull: true,
- defaultValue: null,
- primaryKey: false,
- autoIncrement: false,
- comment: null,
- field: "credited"
- },
- code: {
- type: DataTypes.STRING(255),
- allowNull: true,
- defaultValue: null,
- primaryKey: false,
- autoIncrement: false,
- comment: null,
- field: "code"
- },
-};
-
-const options = {
- tableName: "deposits",
- comment: "",
- indexes: []
-};
-
-db["Deposit"] = db.define("deposits_model", attributes, options);
diff --git a/db/models/invoices.js b/db/models/invoices.js
deleted file mode 100644
index 82e64427..00000000
--- a/db/models/invoices.js
+++ /dev/null
@@ -1,202 +0,0 @@
-import db from "$db/db";
-import { DataTypes } from '@sequelize/core';
-
-const attributes = {
- id: {
- type: DataTypes.INTEGER(11),
- allowNull: false,
- defaultValue: null,
- primaryKey: true,
- autoIncrement: true,
- comment: null,
- field: "id"
- },
- account_id: {
- type: DataTypes.INTEGER(11),
- allowNull: true,
- defaultValue: null,
- primaryKey: false,
- autoIncrement: false,
- comment: null,
- field: "account_id"
- },
- user_id: {
- type: DataTypes.INTEGER(11),
- allowNull: true,
- defaultValue: null,
- primaryKey: false,
- autoIncrement: false,
- comment: null,
- field: "user_id"
- },
- text: {
- type: DataTypes.TEXT,
- allowNull: true,
- defaultValue: null,
- primaryKey: false,
- autoIncrement: false,
- comment: null,
- field: "text"
- },
- 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"
- },
- path: {
- type: DataTypes.STRING(255),
- allowNull: true,
- defaultValue: null,
- primaryKey: false,
- autoIncrement: false,
- comment: null,
- field: "path"
- },
- rate: {
- type: DataTypes.DOUBLE,
- allowNull: true,
- defaultValue: null,
- primaryKey: false,
- autoIncrement: false,
- comment: null,
- field: "rate"
- },
- uuid: {
- type: DataTypes.STRING(255),
- allowNull: true,
- defaultValue: DataTypes.UUIDV4,
- primaryKey: false,
- autoIncrement: false,
- comment: null,
- field: "uuid"
- },
- memo: {
- type: DataTypes.TEXT,
- allowNull: true,
- defaultValue: null,
- primaryKey: false,
- autoIncrement: false,
- comment: null,
- field: "memo"
- },
- network: {
- type: DataTypes.STRING(255),
- allowNull: true,
- defaultValue: null,
- primaryKey: false,
- autoIncrement: false,
- comment: null,
- field: "network"
- },
- currency: {
- type: DataTypes.STRING(255),
- allowNull: true,
- defaultValue: null,
- primaryKey: false,
- autoIncrement: false,
- comment: null,
- field: "currency"
- },
- unconfidential: {
- type: DataTypes.STRING(255),
- allowNull: true,
- defaultValue: null,
- primaryKey: false,
- autoIncrement: false,
- comment: null,
- field: "unconfidential"
- },
- address: {
- type: DataTypes.STRING(255),
- allowNull: true,
- defaultValue: null,
- primaryKey: false,
- autoIncrement: false,
- comment: null,
- field: "address"
- },
- received: {
- type: DataTypes.DOUBLE,
- allowNull: false,
- defaultValue: 0,
- primaryKey: false,
- autoIncrement: false,
- comment: null,
- field: "received"
- },
- amount: {
- type: DataTypes.DOUBLE,
- allowNull: true,
- defaultValue: null,
- primaryKey: false,
- autoIncrement: false,
- comment: null,
- field: "amount"
- },
- pending: {
- type: DataTypes.DOUBLE,
- allowNull: false,
- defaultValue: 0,
- primaryKey: false,
- autoIncrement: false,
- comment: null,
- field: "pending"
- },
- webhook: {
- type: DataTypes.TEXT,
- allowNull: true,
- defaultValue: null,
- primaryKey: false,
- autoIncrement: false,
- comment: null,
- field: "webhook"
- },
- status: {
- type: DataTypes.TEXT,
- allowNull: true,
- defaultValue: "unpaid",
- primaryKey: false,
- autoIncrement: false,
- comment: null,
- field: "status"
- },
- tip: {
- type: DataTypes.DOUBLE,
- allowNull: true,
- defaultValue: null,
- primaryKey: false,
- autoIncrement: false,
- comment: null,
- field: "tip"
- },
- prompt: {
- type: DataTypes.BOOLEAN,
- allowNull: false,
- defaultValue: false,
- primaryKey: false,
- autoIncrement: false,
- comment: null,
- field: "prompt"
- },
-};
-
-const options = {
- tableName: "invoices",
- comment: "",
- indexes: []
-};
-
-db["Invoice"] = db.define("invoices_model", attributes, options);
diff --git a/db/models/keys.js b/db/models/keys.js
deleted file mode 100644
index 5a5fda0c..00000000
--- a/db/models/keys.js
+++ /dev/null
@@ -1,40 +0,0 @@
-import db from "$db/db";
-import { DataTypes } from '@sequelize/core';
-
-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"
- },
- hex: {
- type: DataTypes.STRING(255),
- allowNull: true,
- defaultValue: null,
- primaryKey: false,
- autoIncrement: false,
- comment: null,
- field: "hex"
- },
-};
-
-const options = {
- tableName: "linkingkeys",
- comment: "",
- indexes: []
-};
-
-db["Key"] = db.define("keys_model", attributes, options);
diff --git a/db/models/orders.js b/db/models/orders.js
deleted file mode 100644
index 50a74c40..00000000
--- a/db/models/orders.js
+++ /dev/null
@@ -1,112 +0,0 @@
-import db from "$db/db";
-import { DataTypes } from '@sequelize/core';
-
-const attributes = {
- id: {
- type: DataTypes.INTEGER(11),
- allowNull: false,
- defaultValue: null,
- primaryKey: true,
- autoIncrement: true,
- comment: null,
- field: "id"
- },
- a1_id: {
- type: DataTypes.INTEGER(11),
- allowNull: true,
- defaultValue: null,
- primaryKey: false,
- autoIncrement: false,
- comment: null,
- field: "a1_id"
- },
- a2_id: {
- type: DataTypes.INTEGER(11),
- allowNull: true,
- defaultValue: null,
- primaryKey: false,
- autoIncrement: false,
- comment: null,
- field: "a2_id"
- },
- user_id: {
- type: DataTypes.INTEGER(11),
- allowNull: true,
- defaultValue: null,
- primaryKey: false,
- autoIncrement: false,
- comment: null,
- field: "user_id"
- },
- completedAt: {
- type: DataTypes.DATE,
- allowNull: true,
- defaultValue: null,
- primaryKey: false,
- autoIncrement: false,
- comment: null,
- field: "completedAt"
- },
- 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"
- },
- v1: {
- type: DataTypes.DOUBLE,
- allowNull: true,
- defaultValue: null,
- primaryKey: false,
- autoIncrement: false,
- comment: null,
- field: "v1"
- },
- v2: {
- type: DataTypes.DOUBLE,
- allowNull: true,
- defaultValue: null,
- primaryKey: false,
- autoIncrement: false,
- comment: null,
- field: "v2"
- },
- rate: {
- type: DataTypes.DOUBLE,
- allowNull: true,
- defaultValue: null,
- primaryKey: false,
- autoIncrement: false,
- comment: null,
- field: "rate"
- },
- accepted: {
- type: DataTypes.BOOLEAN,
- allowNull: false,
- defaultValue: false,
- primaryKey: false,
- autoIncrement: false,
- comment: null,
- field: "accepted"
- },
-};
-
-const options = {
- tableName: "orders",
- comment: "",
- indexes: []
-};
-
-db.Order = db.define("orders_model", attributes, options);
diff --git a/db/models/payments.js b/db/models/payments.js
deleted file mode 100644
index fac8ff56..00000000
--- a/db/models/payments.js
+++ /dev/null
@@ -1,220 +0,0 @@
-import db from "$db/db";
-import { DataTypes } from '@sequelize/core';
-
-const attributes = {
- id: {
- type: DataTypes.INTEGER(11),
- allowNull: false,
- defaultValue: null,
- primaryKey: true,
- autoIncrement: true,
- comment: null,
- field: "id"
- },
- with_id: {
- type: DataTypes.INTEGER(11),
- allowNull: true,
- defaultValue: null,
- primaryKey: false,
- autoIncrement: false,
- comment: null,
- field: "with_id"
- },
- account_id: {
- type: DataTypes.INTEGER(11),
- allowNull: true,
- defaultValue: null,
- primaryKey: false,
- autoIncrement: false,
- comment: null,
- field: "account_id"
- },
- invoice_id: {
- type: DataTypes.INTEGER(11),
- allowNull: true,
- defaultValue: null,
- primaryKey: false,
- autoIncrement: false,
- comment: null,
- field: "invoice_id"
- },
- user_id: {
- type: DataTypes.INTEGER(11),
- allowNull: true,
- defaultValue: null,
- primaryKey: false,
- autoIncrement: false,
- comment: null,
- field: "user_id"
- },
- path: {
- type: DataTypes.STRING(255),
- allowNull: true,
- defaultValue: null,
- primaryKey: false,
- autoIncrement: false,
- comment: null,
- field: "path"
- },
- memo: {
- type: DataTypes.TEXT,
- allowNull: true,
- defaultValue: null,
- primaryKey: false,
- autoIncrement: false,
- comment: null,
- field: "memo"
- },
- 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"
- },
- preimage: {
- type: DataTypes.STRING(255),
- allowNull: true,
- defaultValue: null,
- primaryKey: false,
- autoIncrement: false,
- comment: null,
- field: "preimage"
- },
- network: {
- type: DataTypes.STRING(255),
- allowNull: true,
- defaultValue: null,
- primaryKey: false,
- autoIncrement: false,
- comment: null,
- field: "network"
- },
- 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"
- },
- fee: {
- type: DataTypes.DOUBLE,
- allowNull: false,
- defaultValue: 0,
- primaryKey: false,
- autoIncrement: false,
- comment: null,
- field: "fee"
- },
- tip: {
- type: DataTypes.DOUBLE,
- allowNull: false,
- defaultValue: 0,
- primaryKey: false,
- autoIncrement: false,
- comment: null,
- field: "tip"
- },
- redeemed: {
- type: DataTypes.BOOLEAN,
- allowNull: false,
- defaultValue: false,
- primaryKey: false,
- autoIncrement: false,
- comment: null,
- field: "redeemed"
- },
- redeemcode: {
- type: DataTypes.STRING(255),
- allowNull: true,
- defaultValue: null,
- primaryKey: false,
- autoIncrement: false,
- comment: null,
- field: "redeemcode"
- },
- confirmed: {
- type: DataTypes.INTEGER(1),
- allowNull: false,
- defaultValue: null,
- primaryKey: false,
- autoIncrement: false,
- comment: null,
- field: "confirmed"
- },
- fee_payment_id: {
- type: DataTypes.INTEGER(11),
- allowNull: true,
- defaultValue: null,
- primaryKey: false,
- autoIncrement: false,
- comment: null,
- field: "fee_payment_id"
- }
-};
-
-const options = {
- tableName: "payments",
- comment: "",
- indexes: []
-};
-
-db["Payment"] = db.define("payments_model", attributes, options);
diff --git a/db/models/referrals.js b/db/models/referrals.js
deleted file mode 100644
index 8aebde2e..00000000
--- a/db/models/referrals.js
+++ /dev/null
@@ -1,90 +0,0 @@
-import db from "$db/db";
-import { DataTypes } from '@sequelize/core';
-
-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"
- },
- sponsor_id: {
- type: DataTypes.INTEGER(11),
- allowNull: true,
- defaultValue: null,
- primaryKey: false,
- autoIncrement: false,
- comment: null,
- field: "sponsor_id"
- },
-
- token: {
- type: DataTypes.STRING(255),
- allowNull: true,
- defaultValue: null,
- primaryKey: false,
- autoIncrement: false,
- comment: null,
- field: "token"
- },
- expiry: {
- type: DataTypes.DATE(),
- allowNull: true,
- defaultValue: null,
- primaryKey: false,
- autoIncrement: false,
- comment: null,
- field: "token"
- },
- status: {
- type: DataTypes.ENUM,
- values: ['available', 'used', 'expired', 'cancelled'],
- allowNull: true,
- defaultValue: 'available',
- primaryKey: false,
- autoIncrement: false,
- comment: null,
- field: "token"
- }
-};
-
-const options = {
- tableName: "referrals",
- comment: "",
- indexes: []
-};
-
-db["Referral"] = db.define("referrals_model", attributes, options);
-
-// exports.up = function(knex) {
-// return knex.schema.createTable('referrals', function(t) {
-// t.increments('id').unsigned().primary();
-// t.int('user_id').nullable();
-// t.foreign('user_id').references('users.id');
-
-// t.int('sponsor_id').notNull();
-// t.foreign('sponsor_id').references('users.id');
-
-// t.string('token').notNull();
-// t.string('expiry').nullable();
-// t.enum('status', ['available', 'used', 'expired', 'cancelled']).notNull().defaultTo('available');
-
-// t.timestamps();
-// })
-// };
-
-// exports.down = function(knex) {
-// return knex.schema.dropTable('referrals');
-// };
diff --git a/db/models/requests.js b/db/models/requests.js
deleted file mode 100644
index 76703a72..00000000
--- a/db/models/requests.js
+++ /dev/null
@@ -1,67 +0,0 @@
-import db from "$db/db";
-import { DataTypes } from '@sequelize/core';
-
-const attributes = {
- id: {
- type: DataTypes.INTEGER(11),
- allowNull: false,
- defaultValue: null,
- primaryKey: true,
- autoIncrement: true,
- comment: null,
- field: "id"
- },
- requester_id: {
- type: DataTypes.INTEGER(11),
- allowNull: true,
- defaultValue: null,
- primaryKey: false,
- autoIncrement: false,
- comment: null,
- field: "requester_id"
- },
- recipient_id: {
- type: DataTypes.INTEGER(11),
- allowNull: true,
- defaultValue: null,
- primaryKey: false,
- autoIncrement: false,
- comment: null,
- field: "recipient_id"
- },
- memo: {
- type: DataTypes.TEXT,
- allowNull: true,
- defaultValue: null,
- primaryKey: false,
- autoIncrement: false,
- comment: null,
- field: "memo"
- },
- 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"
- },
-};
-
-const options = {
- tableName: "requests",
- comment: "",
- indexes: []
-};
-
-db["Request"] = db.define("requests_model", attributes, options);
diff --git a/db/models/users.js b/db/models/users.js
deleted file mode 100644
index fce79537..00000000
--- a/db/models/users.js
+++ /dev/null
@@ -1,270 +0,0 @@
-import db from "$db/db";
-import { DataTypes } from "@sequelize/core";
-
-const attributes = {
- id: {
- type: DataTypes.INTEGER(11),
- allowNull: false,
- defaultValue: null,
- primaryKey: true,
- autoIncrement: true,
- comment: null,
- field: "id"
- },
- uuid: {
- type: DataTypes.STRING,
- allowNull: false,
- defaultValue: DataTypes.UUIDV4,
- primaryKey: true,
- autoIncrement: false,
- comment: null,
- field: "uuid"
- },
- address: {
- type: DataTypes.STRING,
- allowNull: true,
- defaultValue: null,
- primaryKey: false,
- autoIncrement: false,
- comment: null,
- field: "address"
- },
- theme: {
- type: DataTypes.STRING,
- allowNull: true,
- defaultValue: false,
- primaryKey: false,
- autoIncrement: false,
- comment: null,
- field: "theme"
- },
- profile: {
- type: DataTypes.BOOLEAN,
- allowNull: true,
- defaultValue: false,
- primaryKey: false,
- autoIncrement: false,
- comment: null,
- field: "profile"
- },
- banner: {
- type: DataTypes.BOOLEAN,
- allowNull: true,
- defaultValue: false,
- primaryKey: false,
- autoIncrement: false,
- comment: null,
- field: "banner"
- },
- admin: {
- type: DataTypes.BOOLEAN,
- allowNull: true,
- defaultValue: false,
- primaryKey: false,
- autoIncrement: false,
- comment: null,
- field: "admin"
- },
- locked: {
- type: DataTypes.BOOLEAN,
- allowNull: true,
- defaultValue: false,
- primaryKey: false,
- autoIncrement: false,
- comment: null,
- field: "locked"
- },
- verified: {
- type: DataTypes.STRING,
- allowNull: true,
- defaultValue: null,
- primaryKey: false,
- autoIncrement: false,
- comment: null,
- field: "verified"
- },
- fiat: {
- type: DataTypes.BOOLEAN,
- allowNull: true,
- defaultValue: null,
- primaryKey: false,
- autoIncrement: false,
- comment: null,
- field: "fiat"
- },
- index: {
- type: DataTypes.INTEGER,
- allowNull: true,
- defaultValue: 0,
- primaryKey: false,
- autoIncrement: false,
- comment: null,
- field: "index"
- },
- ip: {
- type: DataTypes.INTEGER.UNSIGNED,
- allowNull: true,
- defaultValue: null,
- primaryKey: false,
- autoIncrement: false,
- comment: null,
- field: "ip"
- },
- seed: {
- type: DataTypes.STRING(255),
- allowNull: true,
- defaultValue: null,
- primaryKey: false,
- autoIncrement: false,
- comment: null,
- field: "seed"
- },
- 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"
- },
- unit: {
- type: DataTypes.STRING(255),
- allowNull: true,
- defaultValue: "SAT",
- primaryKey: false,
- autoIncrement: false,
- comment: null,
- field: "unit"
- },
- account_id: {
- type: DataTypes.INTEGER(11),
- allowNull: true,
- defaultValue: null,
- primaryKey: false,
- autoIncrement: false,
- comment: null,
- field: "account_id"
- },
- otpsecret: {
- type: DataTypes.STRING(255),
- allowNull: true,
- defaultValue: "CAD",
- primaryKey: false,
- autoIncrement: false,
- comment: null,
- field: "otpsecret"
- },
- currency: {
- type: DataTypes.STRING(255),
- allowNull: true,
- defaultValue: "CAD",
- primaryKey: false,
- autoIncrement: false,
- comment: null,
- field: "currency"
- },
- currencies: {
- type: DataTypes.JSON,
- allowNull: false,
- defaultValue: ["USD"],
- primaryKey: false,
- autoIncrement: false,
- comment: null,
- field: "currencies"
- },
- 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"
- },
- subscriptions: {
- type: DataTypes.TEXT,
- get: function() {
- return JSON.parse(this.getDataValue("subscriptions"));
- },
- set: function(value) {
- return this.setDataValue("subscriptions", JSON.stringify(value));
- },
- allowNull: true,
- defaultValue: null,
- primaryKey: false,
- autoIncrement: false,
- comment: null,
- field: "subscriptions"
- },
- twofa: {
- type: DataTypes.INTEGER(1),
- allowNull: true,
- defaultValue: null,
- primaryKey: false,
- autoIncrement: false,
- comment: null,
- field: "twofa"
- },
- cipher: {
- type: DataTypes.STRING(255)
- },
- pubkey: {
- type: DataTypes.STRING(255)
- },
- salt: {
- type: DataTypes.STRING(255)
- },
- pin: {
- type: DataTypes.STRING(255),
- allowNull: true,
- defaultValue: null,
- primaryKey: false,
- autoIncrement: false,
- comment: null,
- field: "pin"
- },
- email: {
- type: DataTypes.STRING(255)
- },
- phone: {
- type: DataTypes.STRING(255)
- },
- locktime: {
- type: DataTypes.INTEGER(11)
- },
- prompt: {
- type: DataTypes.BOOLEAN
- },
- display: {
- type: DataTypes.STRING(255)
- }
-};
-
-const options = {
- tableName: "users",
- comment: "",
- indexes: [],
- charset: "utf8mb4",
- collate: "utf8mb4_unicode_ci"
-};
-
-db["User"] = db.define("users_model", attributes, options);
diff --git a/db/models/waiting_list.js b/db/models/waiting_list.js
deleted file mode 100644
index 37f2889b..00000000
--- a/db/models/waiting_list.js
+++ /dev/null
@@ -1,45 +0,0 @@
-import db from "$db/db";
-import { DataTypes } from '@sequelize/core';
-
-const attributes = {
- id: {
- type: DataTypes.INTEGER(11),
- primaryKey: true,
- autoIncrement: true,
- allowNull: false
- },
- email: {
- type: DataTypes.STRING(255),
- validate: {
- isEmail: true
- }
- },
- phone: {
- type: DataTypes.STRING(255),
- validate: {
- is: /^[0-9]+$/ // replace spaces, brackets, dashes dynamically prior to create
- }
- },
- status: {
- type: DataTypes.ENUM,
- values: ['pending', 'activated', 'expired', 'cancelled'],
- defaultValue: 'pending',
- allowNull: false
- }
-}
-
-const options = {
- tableName: "waiting_list",
- comment: "Users on waiting list",
- timestamps: true,
- createdAt: 'created_at',
- updatedAt: 'updated_at',
- indexes: [
- {
- unique: true,
- fields: ['email', 'phone']
- }
- ]
-};
-
-db["WaitingList"] = db.define("waiting_list_model", attributes, options);
diff --git a/db/models/withdrawals.js b/db/models/withdrawals.js
deleted file mode 100644
index fa2afb22..00000000
--- a/db/models/withdrawals.js
+++ /dev/null
@@ -1,103 +0,0 @@
-import db from "$db/db";
-import { DataTypes } from '@sequelize/core';
-
-const attributes = {
- id: {
- type: DataTypes.INTEGER(11),
- allowNull: false,
- defaultValue: null,
- primaryKey: true,
- autoIncrement: true,
- comment: null,
- field: "id"
- },
- amount: {
- type: DataTypes.DOUBLE,
- allowNull: true,
- defaultValue: null,
- primaryKey: false,
- autoIncrement: false,
- comment: null,
- field: "amount"
- },
- user_id: {
- type: DataTypes.INTEGER(11),
- allowNull: true,
- defaultValue: null,
- primaryKey: false,
- autoIncrement: false,
- comment: null,
- field: "user_id"
- },
- 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"
- },
- transit: {
- type: DataTypes.STRING(255),
- allowNull: true,
- defaultValue: null,
- primaryKey: false,
- autoIncrement: false,
- comment: null,
- field: "transit"
- },
- institution: {
- type: DataTypes.STRING(255),
- allowNull: true,
- defaultValue: null,
- primaryKey: false,
- autoIncrement: false,
- comment: null,
- field: "institution"
- },
- account: {
- type: DataTypes.STRING(255),
- allowNull: true,
- defaultValue: null,
- primaryKey: false,
- autoIncrement: false,
- comment: null,
- field: "account"
- },
- email: {
- type: DataTypes.STRING(255),
- allowNull: true,
- defaultValue: null,
- primaryKey: false,
- autoIncrement: false,
- comment: null,
- field: "email"
- },
- notes: {
- type: DataTypes.TEXT,
- allowNull: true,
- defaultValue: null,
- primaryKey: false,
- autoIncrement: false,
- comment: null,
- field: "notes"
- },
-};
-
-const options = {
- tableName: "withdrawals",
- comment: "",
- indexes: []
-};
-
-db["Withdrawal"] = db.define("withdrawals_model", attributes, options);