aboutsummaryrefslogtreecommitdiffstats
path: root/db/models/requests.js
diff options
context:
space:
mode:
authorAdam Soltys <[email protected]>2022-11-03 16:43:42 -0700
committerAdam Soltys <[email protected]>2022-11-05 11:52:36 -0700
commit9fd5684178cf99890a66d6598b7a8ede6ce933cb (patch)
treea790cfda4f843d05a5d90786074d63919f831fd1 /db/models/requests.js
parent5db1b70d915146b5181375e9242fae1466039027 (diff)
downloadcoinos-server-9fd5684178cf99890a66d6598b7a8ede6ce933cb.tar.gz
coinos-server-9fd5684178cf99890a66d6598b7a8ede6ce933cb.zip
requests table
Diffstat (limited to 'db/models/requests.js')
-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);