aboutsummaryrefslogtreecommitdiffstats
path: root/db/normalized/networks.js
diff options
context:
space:
mode:
authorRan Guin <[email protected]>2021-05-11 18:28:25 -0700
committerAdam Soltys <[email protected]>2021-06-04 22:37:02 -0700
commit2e18dc7a532d07d6e53581e5076c7d61a45d6d65 (patch)
treeb6bbd72253c806af56d3640f9e97414f6f4cba19 /db/normalized/networks.js
parent421accbfbc0a1add93f7704e657ae93f2d836b82 (diff)
downloadcoinos-server-2e18dc7a532d07d6e53581e5076c7d61a45d6d65.tar.gz
coinos-server-2e18dc7a532d07d6e53581e5076c7d61a45d6d65.zip
add first draft of normalized schema
Diffstat (limited to 'db/normalized/networks.js')
-rw-r--r--db/normalized/networks.js32
1 files changed, 32 insertions, 0 deletions
diff --git a/db/normalized/networks.js b/db/normalized/networks.js
new file mode 100644
index 00000000..f08880fd
--- /dev/null
+++ b/db/normalized/networks.js
@@ -0,0 +1,32 @@
+const { DataTypes } = require('sequelize');
+
+const attributes = {
+ id: {
+ type: DataTypes.INTEGER(11),
+ primaryKey: true,
+ autoIncrement: true,
+ allowNull: false
+ },
+ name: {
+ type: DataTypes.STRING(255),
+ allowNull: false
+ },
+ code: {
+ type: DataTypes.STRING(255)
+ }
+}
+const options = {
+ tableName: "networks",
+ comment: "",
+ timestamps: true,
+ createdAt: 'created_at',
+ updatedAt: 'updated_at',
+ indexes: [
+ {
+ unique: true,
+ fields: ['name', 'code']
+ }
+ ]
+};
+
+db["Network"] = db.define("networks_model", attributes, options);