From 2e18dc7a532d07d6e53581e5076c7d61a45d6d65 Mon Sep 17 00:00:00 2001 From: Ran Guin Date: Tue, 11 May 2021 18:28:25 -0700 Subject: add first draft of normalized schema --- db/normalized/non_custodial_accounts.js | 69 +++++++++++++++++++++++++++++++++ 1 file changed, 69 insertions(+) create mode 100644 db/normalized/non_custodial_accounts.js (limited to 'db/normalized/non_custodial_accounts.js') diff --git a/db/normalized/non_custodial_accounts.js b/db/normalized/non_custodial_accounts.js new file mode 100644 index 00000000..0f95d59d --- /dev/null +++ b/db/normalized/non_custodial_accounts.js @@ -0,0 +1,69 @@ +const { DataTypes } = require('sequelize'); + +const attributes = { + id: { + type: DataTypes.INTEGER(11), + primaryKey: true, + autoIncrement: true, + allowNull: false + }, + account_id: { + type: DataTypes.INTEGER(11), + references: { model: Account, key: 'id' }, + allowNull: false, + comment: "Reference to account" + }, + path: { + type: DataTypes.STRING(255), + comment: "What is this ?" + }, + seed: { + type: DataTypes.STRING(255), + comment: "What is this ?" + }, + network: { + type: DataTypes.INTEGER(11), + references: { model: Network, key: 'id' }, + allowNull: false, + comment: "Reference to network" + }, + domain: { + type: DataTypes.STRING(255), + comment: "What is this ? ... is it unique or an enum ?" + }, + ticker: { + type: DataTypes.STRING(255), + comment: "What is this ?" + }, + hide: { + type: DataTypes.STRING(255), + comment: "What is this ?" + }, + index: { + type: DataTypes.STRING(255), + comment: "What is this ?" + }, + pub_key: { + type: DataTypes.STRING(255), + comment: "What is this ?" + }, + priv_key: { + type: DataTypes.STRING(255), + comment: "What is this ?" + } +} +const options = { + tableName: "non_custodial_accounts", + comment: "", + timestamps: true, + createdAt: 'created_at', + updatedAt: 'updated_at', + indexes: [ + { + unique: true, + fields: ['account_id'] + } + ] +}; + +db["NonCustodialAccount"] = db.define("non_custodial_accounts_model", attributes, options); -- cgit v1.2.3