aboutsummaryrefslogtreecommitdiffstats
path: root/db/normalized/codes.js
diff options
context:
space:
mode:
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);