'use strict'

module.exports = function (sequelize, DataTypes) {
  const File = sequelize.define('File', {
    id: { type: DataTypes.STRING, primaryKey: true },
    caption: { type: DataTypes.JSON, defaultValue: '{"en":""}'},
    mime: { type: DataTypes.STRING },
    filename: { type: DataTypes.STRING }
  }, {
    paranoid: true,
    underscored: true,
    tableName: 'file',
    instanceMethods: {
      setCaption (text, lang) {
        this.caption[lang] = text
      },
      getCaption (lang) {
        return this.caption[lang]
      },
      toJSON () {
        return this.get({ plain: true })
      }
    }
  })

  return File
}

@@ -227,16 +227,20 @@
     mime
+type
 : %7B type
@@ -257,17 +257,58 @@
 s.STRING
- 
+, defaultValue: 'application/octet-stream'
 %7D,%0A    f

Add features