diff --git a/server/sequelize/models/BookReference.js b/server/sequelize/models/BookReference.js index 812b7da..4f1a41f 100644 --- a/server/sequelize/models/BookReference.js +++ b/server/sequelize/models/BookReference.js @@ -18,8 +18,8 @@ module.exports = sequelize => sequelize.define('BookReference', { sources: { type: Sequelize.JSON, allowNull: false, - defaultValue: [], - comment: 'A JSON array with each element being an object with named source and source id ', + defaultValue: {}, + comment: 'A JSON object with each key a source name and value a source id', }, covers: { type: Sequelize.JSON, @@ -27,6 +27,12 @@ module.exports = sequelize => sequelize.define('BookReference', { defaultValue: [], comment: 'A JSON array with each element being an object with image url and source id ', }, + locale: { + type: Sequelize.STRING, + allowNull: false, + defaultValue: 'en', + comment: 'A basic locale string', + }, }, { timestamps: false, indexes: [ @@ -40,5 +46,8 @@ module.exports = sequelize => sequelize.define('BookReference', { { fields: ['description'], }, + { + fields: ['locale'], + }, ], }); \ No newline at end of file