From 64b7712c67b773678a43790ffbc7a7e147ae956b Mon Sep 17 00:00:00 2001 From: Leon Vreling <49942406+LeonVreling@users.noreply.github.com> Date: Mon, 10 Jul 2023 21:18:18 +0200 Subject: [PATCH] feat(events): Add option to make events fully vegetarian (#967) --- .../20230709170940-add-vegetarian-column-to-events.js | 8 ++++++++ models/Event.js | 5 +++++ 2 files changed, 13 insertions(+) create mode 100644 migrations/20230709170940-add-vegetarian-column-to-events.js diff --git a/migrations/20230709170940-add-vegetarian-column-to-events.js b/migrations/20230709170940-add-vegetarian-column-to-events.js new file mode 100644 index 00000000..1e3a42f4 --- /dev/null +++ b/migrations/20230709170940-add-vegetarian-column-to-events.js @@ -0,0 +1,8 @@ +module.exports = { + up: (queryInterface, Sequelize) => queryInterface.addColumn( + 'events', + 'vegetarian', + { type: Sequelize.BOOLEAN, allowNull: false, defaultValue: false } + ), + down: (queryInterface) => queryInterface.removeColumn('events', 'vegetarian') +}; diff --git a/models/Event.js b/models/Event.js index f3c76e18..62d2be8d 100644 --- a/models/Event.js +++ b/models/Event.js @@ -370,6 +370,11 @@ const Event = sequelize.define( max: { args: [4], msg: 'You cannot offer more than 4 meals per day' }, }, }, + vegetarian: { + type: Sequelize.BOOLEAN, + allowNull: false, + defaultValue: false, + }, accommodation_type: { type: Sequelize.STRING, allowNull: false,