From bdae46a304242cdbceb375a0cbeea43159d03a21 Mon Sep 17 00:00:00 2001 From: lesion Date: Mon, 23 Dec 2024 17:06:16 +0100 Subject: [PATCH] add slug place property --- server/api/models/index.js | 1 + server/api/models/place.js | 5 +++++ 2 files changed, 6 insertions(+) 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,