aboutsummaryrefslogtreecommitdiffstats
path: root/db
diff options
context:
space:
mode:
authorAdam Soltys <[email protected]>2022-11-03 16:43:42 -0700
committerAdam Soltys <[email protected]>2022-11-03 16:43:49 -0700
commitf6b8e5157b01cddd30b9e0674c0edc9de977cb42 (patch)
treee533fdd5dddbaa3d324f9768d718d576e9f4382f /db
parentd06acb3b41c76e0de47176f394c008fe68d25a2a (diff)
downloadcoinos-server-f6b8e5157b01cddd30b9e0674c0edc9de977cb42.tar.gz
coinos-server-f6b8e5157b01cddd30b9e0674c0edc9de977cb42.zip
requests table
Diffstat (limited to 'db')
-rw-r--r--db/index.js1
-rw-r--r--db/models/requests.js67
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);