diff options
| author | Adam Soltys <[email protected]> | 2020-09-27 13:25:59 -0700 |
|---|---|---|
| committer | Adam Soltys <[email protected]> | 2020-09-27 13:25:59 -0700 |
| commit | 8d42a328880dae07960c56a81649583aab0e71f3 (patch) | |
| tree | 2fcb671868c742c420c1c2bbb5f0c2587d248a14 /db/models | |
| parent | 4849c6ac324df67d2f5fc20ed4a958fe9a2bfa1f (diff) | |
| download | coinos-server-8d42a328880dae07960c56a81649583aab0e71f3.tar.gz coinos-server-8d42a328880dae07960c56a81649583aab0e71f3.zip | |
use account foreign keys in proposals table
Diffstat (limited to 'db/models')
| -rw-r--r-- | db/models/proposals.js | 40 |
1 files changed, 20 insertions, 20 deletions
diff --git a/db/models/proposals.js b/db/models/proposals.js index ca3de8eb..44f2f796 100644 --- a/db/models/proposals.js +++ b/db/models/proposals.js @@ -1,4 +1,4 @@ -const { DataTypes } = require('sequelize'); +const { DataTypes } = require("sequelize"); const attributes = { id: { @@ -10,6 +10,24 @@ const attributes = { 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, @@ -46,24 +64,6 @@ const attributes = { comment: null, field: "updatedAt" }, - a1: { - type: DataTypes.STRING(255), - allowNull: true, - defaultValue: null, - primaryKey: false, - autoIncrement: false, - comment: null, - field: "a1" - }, - a2: { - type: DataTypes.STRING(255), - allowNull: true, - defaultValue: null, - primaryKey: false, - autoIncrement: false, - comment: null, - field: "a2" - }, v1: { type: DataTypes.DOUBLE, allowNull: true, @@ -126,4 +126,4 @@ const options = { indexes: [] }; -db["Proposal"] = db.define("proposals_model", attributes, options); +db.Proposal = db.define("proposals_model", attributes, options); |
