-- AlterTable
ALTER TABLE `Provider` ADD COLUMN `coverUrl` VARCHAR(191) NULL;

-- CreateTable
CREATE TABLE `ProviderMedia` (
    `id` VARCHAR(191) NOT NULL,
    `providerId` VARCHAR(191) NOT NULL,
    `role` VARCHAR(32) NOT NULL,
    `url` VARCHAR(191) NOT NULL,
    `storageKey` VARCHAR(512) NOT NULL,
    `sortOrder` INTEGER NOT NULL DEFAULT 0,
    `createdAt` DATETIME(3) NOT NULL DEFAULT CURRENT_TIMESTAMP(3),

    UNIQUE INDEX `ProviderMedia_storageKey_key`(`storageKey`),
    INDEX `ProviderMedia_providerId_role_idx`(`providerId`, `role`),
    PRIMARY KEY (`id`)
) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;

-- AddForeignKey
ALTER TABLE `ProviderMedia` ADD CONSTRAINT `ProviderMedia_providerId_fkey` FOREIGN KEY (`providerId`) REFERENCES `Provider`(`id`) ON DELETE CASCADE ON UPDATE CASCADE;
