fix migrations
This commit is contained in:
@ -1,8 +1,9 @@
|
|||||||
-- AlterTable
|
-- AlterTable
|
||||||
ALTER TABLE `message` ADD COLUMN `answer` VARCHAR(191) NULL,
|
ALTER TABLE `Message`
|
||||||
ADD COLUMN `answerDate` DATETIME(3) NULL,
|
ADD COLUMN `answer` VARCHAR(191) NULL,
|
||||||
ADD COLUMN `shownDate` DATETIME(3) NULL,
|
ADD COLUMN `answerDate` DATETIME(3) NULL,
|
||||||
ADD COLUMN `surveyId` INTEGER NULL;
|
ADD COLUMN `shownDate` DATETIME(3) NULL,
|
||||||
|
ADD COLUMN `surveyId` INTEGER NULL;
|
||||||
|
|
||||||
-- CreateTable
|
-- CreateTable
|
||||||
CREATE TABLE `Survey` (
|
CREATE TABLE `Survey` (
|
||||||
@ -12,8 +13,10 @@ CREATE TABLE `Survey` (
|
|||||||
`publicFrom` DATETIME(3) NULL,
|
`publicFrom` DATETIME(3) NULL,
|
||||||
`publicUntil` DATETIME(3) NULL,
|
`publicUntil` DATETIME(3) NULL,
|
||||||
|
|
||||||
|
|
||||||
PRIMARY KEY (`id`)
|
PRIMARY KEY (`id`)
|
||||||
) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
|
) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
|
||||||
|
|
||||||
-- AddForeignKey
|
-- AddForeignKey
|
||||||
ALTER TABLE `Message` ADD CONSTRAINT `Message_surveyId_fkey` FOREIGN KEY (`surveyId`) REFERENCES `Survey`(`id`) ON DELETE SET NULL ON UPDATE CASCADE;
|
ALTER TABLE `Message`
|
||||||
|
ADD CONSTRAINT `Message_surveyId_fkey` FOREIGN KEY (`surveyId`) REFERENCES `Survey` (`id`) ON DELETE SET NULL ON UPDATE CASCADE;
|
@ -1,5 +1,6 @@
|
|||||||
-- DropForeignKey
|
-- DropForeignKey
|
||||||
ALTER TABLE `message` DROP FOREIGN KEY `Message_surveyId_fkey`;
|
ALTER TABLE `Message` DROP FOREIGN KEY `Message_surveyId_fkey`;
|
||||||
|
|
||||||
-- AddForeignKey
|
-- AddForeignKey
|
||||||
ALTER TABLE `Message` ADD CONSTRAINT `Message_surveyId_fkey` FOREIGN KEY (`surveyId`) REFERENCES `Survey`(`id`) ON DELETE CASCADE ON UPDATE CASCADE;
|
ALTER TABLE `Message`
|
||||||
|
ADD CONSTRAINT `Message_surveyId_fkey` FOREIGN KEY (`surveyId`) REFERENCES `Survey` (`id`) ON DELETE CASCADE ON UPDATE CASCADE;
|
Reference in New Issue
Block a user