/*
  Warnings:

  - You are about to drop the column `meetingUrl` on the `Conference` table. All the data in the column will be lost.
  - You are about to drop the column `imageUrl` on the `Speaker` table. All the data in the column will be lost.
  - You are about to drop the column `institution` on the `Speaker` table. All the data in the column will be lost.
  - You are about to drop the column `title` on the `Speaker` table. All the data in the column will be lost.

*/
-- AlterTable
ALTER TABLE `Conference` DROP COLUMN `meetingUrl`,
    ADD COLUMN `meetingLink` VARCHAR(191) NULL,
    ADD COLUMN `posterUrl` VARCHAR(191) NULL;

-- AlterTable
ALTER TABLE `Speaker` DROP COLUMN `imageUrl`,
    DROP COLUMN `institution`,
    DROP COLUMN `title`,
    ADD COLUMN `role` VARCHAR(191) NOT NULL DEFAULT 'SPEAKER';

-- CreateTable
CREATE TABLE `ConferenceChair` (
    `id` INTEGER NOT NULL AUTO_INCREMENT,
    `userId` INTEGER NOT NULL,
    `conferenceId` INTEGER NOT NULL,
    `grantedAt` DATETIME(3) NOT NULL DEFAULT CURRENT_TIMESTAMP(3),

    INDEX `ConferenceChair_conferenceId_idx`(`conferenceId`),
    UNIQUE INDEX `ConferenceChair_userId_conferenceId_key`(`userId`, `conferenceId`),
    PRIMARY KEY (`id`)
) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;

-- AddForeignKey
ALTER TABLE `ConferenceChair` ADD CONSTRAINT `ConferenceChair_userId_fkey` FOREIGN KEY (`userId`) REFERENCES `User`(`id`) ON DELETE CASCADE ON UPDATE CASCADE;

-- AddForeignKey
ALTER TABLE `ConferenceChair` ADD CONSTRAINT `ConferenceChair_conferenceId_fkey` FOREIGN KEY (`conferenceId`) REFERENCES `Conference`(`id`) ON DELETE CASCADE ON UPDATE CASCADE;
