aboutsummaryrefslogtreecommitdiffstats
path: root/db/normalized/codes.js
diff options
context:
space:
mode:
authorRan Guin <[email protected]>2021-05-11 18:28:25 -0700
committerRan Guin <[email protected]>2021-05-11 18:28:25 -0700
commit0b0994f4795759c7ddc08203522d8488bb4a5646 (patch)
treede8237ad37f3341b216dca12b6aea0aebaa3f89d /db/normalized/codes.js
parent38ba24080dd50b1993772ba822c3db83876c4fd3 (diff)
downloadcoinos-server-0b0994f4795759c7ddc08203522d8488bb4a5646.tar.gz
coinos-server-0b0994f4795759c7ddc08203522d8488bb4a5646.zip
add first draft of normalized schema
Diffstat (limited to 'db/normalized/codes.js')
-rw-r--r--db/normalized/codes.js27
1 files changed, 27 insertions, 0 deletions
diff --git a/db/normalized/codes.js b/db/normalized/codes.js
new file mode 100644
index 00000000..956fe56a
--- /dev/null
+++ b/db/normalized/codes.js
@@ -0,0 +1,27 @@
+const { DataTypes } = require('sequelize');
+
+const attributes = {
+ code: {
+ type: DataTypes.INTEGER(11),
+ primaryKey: true,
+ allowNull: false
+ },
+ name: {
+ type: DataTypes.STRING(255)
+ }
+}
+const options = {
+ tableName: "codes",
+ comment: "",
+ timestamps: true,
+ createdAt: 'created_at',
+ updatedAt: 'updated_at',
+ indexes: [
+ {
+ unique: true,
+ fields: ['code']
+ }
+ ]
+};
+
+db["Code"] = db.define("codes_model", attributes, options);