Files
mwitnessing/prisma/migrations/20240616203120_add_survey_table/migration.sql
Dobromir Popov 8ca2000ee4 new table for settings and store blocked date there;
non admins can't enter avs before the blocked date
new table for survey
2024-06-16 23:33:49 +03:00

20 lines
673 B
SQL

-- AlterTable
ALTER TABLE `message` ADD COLUMN `answer` VARCHAR(191) NULL,
ADD COLUMN `answerDate` DATETIME(3) NULL,
ADD COLUMN `shownDate` DATETIME(3) NULL,
ADD COLUMN `surveyId` INTEGER NULL;
-- CreateTable
CREATE TABLE `Survey` (
`id` INTEGER NOT NULL AUTO_INCREMENT,
`content` VARCHAR(191) NOT NULL,
`answers` JSON NULL,
`publicFrom` DATETIME(3) NULL,
`publicUntil` DATETIME(3) NULL,
PRIMARY KEY (`id`)
) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
-- AddForeignKey
ALTER TABLE `Message` ADD CONSTRAINT `Message_surveyId_fkey` FOREIGN KEY (`surveyId`) REFERENCES `Survey`(`id`) ON DELETE SET NULL ON UPDATE CASCADE;