-- CreateTable
CREATE TABLE `notification` (
  `id` INTEGER NOT NULL AUTO_INCREMENT,
  `content` LONGTEXT NOT NULL,
  `extra_content` LONGTEXT NULL,
  `title` TEXT NOT NULL,
  `type` VARCHAR(191) NOT NULL,
  `creation_date` DATETIME(3) NOT NULL DEFAULT CURRENT_TIMESTAMP(3),
  `read` BOOLEAN NOT NULL DEFAULT FALSE,
  `onScreen` BOOLEAN NOT NULL DEFAULT FALSE,
  `user_id` INTEGER NOT NULL,
  PRIMARY KEY (`id`)
) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;

-- CreateIndex
CREATE INDEX `notification_user_id_idx` ON `notification`(`user_id`);

-- AddForeignKey
ALTER TABLE `notification`
  ADD CONSTRAINT `notification_user_id_fkey`
  FOREIGN KEY (`user_id`) REFERENCES `Kezelo`(`Azonosito`)
  ON DELETE CASCADE
  ON UPDATE CASCADE;
