new table - event log

This commit is contained in:
Dobromir Popov
2024-04-18 12:33:51 +03:00
parent c161a5f0ca
commit cb9f92517d
3 changed files with 40 additions and 0 deletions

View File

@ -0,0 +1,20 @@
-- CreateTable
CREATE TABLE `EventLog` (
`id` INTEGER NOT NULL AUTO_INCREMENT,
`date` DATETIME(3) NOT NULL,
`publisherId` VARCHAR(191) NULL,
`shiftId` INTEGER NULL,
`content` VARCHAR(191) NOT NULL,
`type` ENUM('AssignnementReplacementRequested', 'AssignnementReplacement', 'SentEmail') NOT NULL,
PRIMARY KEY (`id`)
) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
-- AddForeignKey
ALTER TABLE `EventLog`
ADD CONSTRAINT `EventLog_publisherId_fkey` FOREIGN KEY (`publisherId`) REFERENCES `Publisher` (`id`) ON DELETE SET NULL ON UPDATE CASCADE;
-- AddForeignKey
ALTER TABLE `EventLog`
ADD CONSTRAINT `EventLog_shiftId_fkey` FOREIGN KEY (`shiftId`) REFERENCES `Shift` (`id`) ON DELETE SET NULL ON UPDATE CASCADE;