summaryrefslogtreecommitdiff
path: root/lib/models/index.js
diff options
context:
space:
mode:
Diffstat (limited to 'lib/models/index.js')
-rw-r--r--lib/models/index.js7
1 files changed, 7 insertions, 0 deletions
diff --git a/lib/models/index.js b/lib/models/index.js
index de6cd13c..6d0fd3c3 100644
--- a/lib/models/index.js
+++ b/lib/models/index.js
@@ -20,6 +20,13 @@ if (config.dburl)
else
sequelize = new Sequelize(dbconfig.database, dbconfig.username, dbconfig.password, dbconfig);
+// [Postgres] Handling NULL bytes
+// https://github.com/sequelize/sequelize/issues/6485
+function stripNullByte(value) {
+ return value ? value.replace(/\u0000/g, "") : value;
+}
+sequelize.stripNullByte = stripNullByte;
+
var db = {};
fs