diff options
| author | Adam Soltys <[email protected]> | 2022-11-03 16:43:42 -0700 |
|---|---|---|
| committer | Adam Soltys <[email protected]> | 2022-11-05 11:52:36 -0700 |
| commit | 9fd5684178cf99890a66d6598b7a8ede6ce933cb (patch) | |
| tree | a790cfda4f843d05a5d90786074d63919f831fd1 /db | |
| parent | 5db1b70d915146b5181375e9242fae1466039027 (diff) | |
| download | coinos-server-9fd5684178cf99890a66d6598b7a8ede6ce933cb.tar.gz coinos-server-9fd5684178cf99890a66d6598b7a8ede6ce933cb.zip | |
requests table
Diffstat (limited to 'db')
| -rw-r--r-- | db/index.js | 1 | ||||
| -rw-r--r-- | db/models/requests.js | 67 |
2 files changed, 68 insertions, 0 deletions
diff --git a/db/index.js b/db/index.js index 81c0fe46..749f770b 100644 --- a/db/index.js +++ b/db/index.js @@ -13,6 +13,7 @@ import "./models/invoices"; import "./models/keys"; import "./models/payments"; import "./models/orders"; +import "./models/requests"; import "./models/users"; import "./models/withdrawals"; diff --git a/db/models/requests.js b/db/models/requests.js new file mode 100644 index 00000000..76703a72 --- /dev/null +++ b/db/models/requests.js @@ -0,0 +1,67 @@ +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); |
