From d62956fb8d0c6a12a8dccefd83572b5e305146a1 Mon Sep 17 00:00:00 2001 From: nurjinn jafar Date: Fri, 4 Dec 2020 16:12:03 +0100 Subject: [PATCH] removed whiteboard entry from add widget db file and added in a new db file specific for whiteboard --- .../migrations/20171218203245-AddWidgets.ts | 10 +------- .../20201204142645-AddWhiteboardWidget.ts | 24 +++++++++++++++++++ 2 files changed, 25 insertions(+), 9 deletions(-) create mode 100644 src/db/migrations/20201204142645-AddWhiteboardWidget.ts diff --git a/src/db/migrations/20171218203245-AddWidgets.ts b/src/db/migrations/20171218203245-AddWidgets.ts index 44da97b..9d60881 100644 --- a/src/db/migrations/20171218203245-AddWidgets.ts +++ b/src/db/migrations/20171218203245-AddWidgets.ts @@ -32,14 +32,6 @@ export default { description: "Collaborate on documents with members of your room.", optionsJson: '{"defaultUrl":"https://scalar.vector.im/etherpad/p/$roomId_$padName"}', }, - { - type: "whiteboard", - name: "Whiteboard", - avatarUrl: "/img/avatars/whiteboard.png", - isEnabled: true, - isPublic: true, - description: "A whiteboard app embedded in the room.", - }, { type: "googlecalendar", name: "Google Calendar", @@ -86,4 +78,4 @@ export default { down: (queryInterface: QueryInterface) => { return queryInterface.dropTable("dimension_widgets"); } -} \ No newline at end of file +} diff --git a/src/db/migrations/20201204142645-AddWhiteboardWidget.ts b/src/db/migrations/20201204142645-AddWhiteboardWidget.ts new file mode 100644 index 0000000..68192c4 --- /dev/null +++ b/src/db/migrations/20201204142645-AddWhiteboardWidget.ts @@ -0,0 +1,24 @@ +import { QueryInterface } from "sequelize"; + +export default { + up: (queryInterface: QueryInterface) => { + return Promise.resolve() + .then(() => queryInterface.bulkInsert("dimension_widgets", [ + { + type: "whiteboard", + name: "Whiteboard", + avatarUrl: "/img/avatars/whiteboard.png", + isEnabled: true, + isPublic: true, + description: "A whiteboard app embedded in the room.", + optionsJson: '{"defaultUrl":"https://cloud13.de/testwhiteboard/?whiteboardid=$roomId_$boardName"}', + } + ])); + }, + down: (queryInterface: QueryInterface) => { + return Promise.resolve() + .then(() => queryInterface.bulkDelete("dimension_widgets", { + type: "whiteboard", + })); + } +}