aboutsummaryrefslogtreecommitdiffstats
path: root/db/models
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/models
parentd06acb3b41c76e0de47176f394c008fe68d25a2a (diff)
downloadcoinos-server-f6b8e5157b01cddd30b9e0674c0edc9de977cb42.tar.gz
coinos-server-f6b8e5157b01cddd30b9e0674c0edc9de977cb42.zip
requests table
Diffstat (limited to 'db/models')
-rw-r--r--db/models/requests.js67
1 files changed, 67 insertions, 0 deletions
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);