diff --git a/server/api/models/index.js b/server/api/models/index.js index ce748ff7..3e8e04be 100644 --- a/server/api/models/index.js +++ b/server/api/models/index.js @@ -82,6 +82,7 @@ const db = { Event.belongsTo(Event, { as: 'parent' }) SequelizeSlugify.slugifyModel(Event, { source: ['title'], overwrite: false }) + SequelizeSlugify.slugifyModel(Place, { source: ['name'], overwrite: false }) }, close() { diff --git a/server/api/models/place.js b/server/api/models/place.js index 734824d5..547bc64a 100644 --- a/server/api/models/place.js +++ b/server/api/models/place.js @@ -6,6 +6,11 @@ module.exports = (sequelize, DataTypes) => index: true, allowNull: false }, + slug: { + type: DataTypes.STRING, + index: true, + unique: true + }, address: DataTypes.STRING, latitude: DataTypes.FLOAT, longitude: DataTypes.FLOAT,