aboutsummaryrefslogtreecommitdiffstats
path: root/db/models
diff options
context:
space:
mode:
authorAdam Soltys <[email protected]>2020-04-05 21:50:05 -0700
committerAdam Soltys <[email protected]>2020-04-11 21:29:23 -0700
commite9b8303212f1e463ad6927e1b3df404a4358db96 (patch)
treebd83e632fcc3a1c6ba279fbda6fc48140e252411 /db/models
parent1738b0feeef4f2d44aeac58bdd27236684792f64 (diff)
downloadcoinos-server-e9b8303212f1e463ad6927e1b3df404a4358db96.tar.gz
coinos-server-e9b8303212f1e463ad6927e1b3df404a4358db96.zip
accounts table
Diffstat (limited to 'db/models')
-rw-r--r--db/models/accounts.js66
1 files changed, 66 insertions, 0 deletions
diff --git a/db/models/accounts.js b/db/models/accounts.js
new file mode 100644
index 00000000..57c9e82a
--- /dev/null
+++ b/db/models/accounts.js
@@ -0,0 +1,66 @@
+const { DataTypes } = require('sequelize');
+
+const attributes = {
+ id: {
+ type: DataTypes.INTEGER(11),
+ allowNull: false,
+ defaultValue: null,
+ primaryKey: true,
+ autoIncrement: true,
+ comment: null,
+ field: "id"
+ },
+ user_id: {
+ type: DataTypes.INTEGER(11),
+ allowNull: true,
+ defaultValue: null,
+ primaryKey: false,
+ autoIncrement: false,
+ comment: null,
+ field: "user_id"
+ },
+ 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"
+ },
+ asset: {
+ type: DataTypes.STRING(255),
+ allowNull: true,
+ defaultValue: null,
+ primaryKey: false,
+ autoIncrement: false,
+ comment: null,
+ field: "asset"
+ },
+ balance: {
+ type: DataTypes.DOUBLE,
+ allowNull: true,
+ defaultValue: null,
+ primaryKey: false,
+ autoIncrement: false,
+ comment: null,
+ field: "balance"
+ },
+};
+
+const options = {
+ tableName: "accounts",
+ comment: "",
+ indexes: []
+};
+
+db["Account"] = db.define("accounts_model", attributes, options);