-- CreateTable
CREATE TABLE `confession_likes` (
    `id` VARCHAR(191) NOT NULL,
    `confessionId` VARCHAR(191) NOT NULL,
    `userId` VARCHAR(191) NOT NULL,
    `createdAt` DATETIME(3) NOT NULL DEFAULT CURRENT_TIMESTAMP(3),

    UNIQUE INDEX `confession_likes_confessionId_userId_key`(`confessionId`, `userId`),
    PRIMARY KEY (`id`)
) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;

-- AddForeignKey
ALTER TABLE `confession_likes` ADD CONSTRAINT `confession_likes_confessionId_fkey` FOREIGN KEY (`confessionId`) REFERENCES `confessions`(`id`) ON DELETE CASCADE ON UPDATE CASCADE;

-- AddForeignKey
ALTER TABLE `confession_likes` ADD CONSTRAINT `confession_likes_userId_fkey` FOREIGN KEY (`userId`) REFERENCES `users`(`id`) ON DELETE CASCADE ON UPDATE CASCADE;
