diff options
| author | Adam Soltys <[email protected]> | 2020-04-24 22:46:45 -0700 |
|---|---|---|
| committer | Adam Soltys <[email protected]> | 2020-04-28 22:33:02 -0700 |
| commit | fae6e8b55ea12989d688eb777c002222199c169b (patch) | |
| tree | 3efed4974408fc1bc8911aa9fb9fc657456d69ee /db/models | |
| parent | 306357c24d3014b55ae1cd25b954a695ea2e5cc6 (diff) | |
| download | coinos-server-fae6e8b55ea12989d688eb777c002222199c169b.tar.gz coinos-server-fae6e8b55ea12989d688eb777c002222199c169b.zip | |
improved assets support
Diffstat (limited to 'db/models')
| -rw-r--r-- | db/models/accounts.js | 27 | ||||
| -rw-r--r-- | db/models/payments.js | 13 | ||||
| -rw-r--r-- | db/models/users.js | 78 |
3 files changed, 41 insertions, 77 deletions
diff --git a/db/models/accounts.js b/db/models/accounts.js index aeaf8d5e..a4b38992 100644 --- a/db/models/accounts.js +++ b/db/models/accounts.js @@ -37,6 +37,24 @@ const attributes = { comment: null, field: "updatedAt" }, + name: { + type: DataTypes.STRING(255), + allowNull: true, + defaultValue: null, + primaryKey: false, + autoIncrement: false, + comment: null, + field: "name" + }, + ticker: { + type: DataTypes.STRING(255), + allowNull: true, + defaultValue: null, + primaryKey: false, + autoIncrement: false, + comment: null, + field: "ticker" + }, asset: { type: DataTypes.STRING(255), allowNull: true, @@ -64,6 +82,15 @@ const attributes = { comment: null, field: "pending" }, + precision: { + type: DataTypes.DOUBLE, + allowNull: true, + defaultValue: null, + primaryKey: false, + autoIncrement: false, + comment: null, + field: "precision" + }, }; const options = { diff --git a/db/models/payments.js b/db/models/payments.js index c6dd6e83..8c464293 100644 --- a/db/models/payments.js +++ b/db/models/payments.js @@ -10,6 +10,15 @@ const attributes = { 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, @@ -55,14 +64,14 @@ const attributes = { comment: null, field: "rate" }, - asset: { + network: { type: DataTypes.STRING(255), allowNull: true, defaultValue: null, primaryKey: false, autoIncrement: false, comment: null, - field: "asset" + field: "network" }, currency: { type: DataTypes.STRING(255), diff --git a/db/models/users.js b/db/models/users.js index 48e8c94f..439ddb63 100644 --- a/db/models/users.js +++ b/db/models/users.js @@ -64,14 +64,14 @@ const attributes = { comment: null, field: "address" }, - symbol: { - type: DataTypes.STRING(255), + account_id: { + type: DataTypes.INTEGER(11), allowNull: true, defaultValue: null, primaryKey: false, autoIncrement: false, comment: null, - field: "symbol" + field: "account_id" }, otpsecret: { type: DataTypes.STRING(255), @@ -100,24 +100,6 @@ const attributes = { comment: null, field: "currencies" }, - 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, @@ -145,42 +127,6 @@ const attributes = { 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, @@ -190,24 +136,6 @@ const attributes = { 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, |
