-- AlterTable
ALTER TABLE `GalleryImage` ADD COLUMN `approvalStatus` ENUM('PENDING', 'APPROVED', 'REJECTED') NOT NULL DEFAULT 'APPROVED',
    ADD COLUMN `approvedById` VARCHAR(191) NULL,
    ADD COLUMN `authorId` VARCHAR(191) NULL,
    ADD COLUMN `rejectionReason` TEXT NULL;

-- AlterTable
ALTER TABLE `Post` ADD COLUMN `approvalStatus` ENUM('PENDING', 'APPROVED', 'REJECTED') NOT NULL DEFAULT 'APPROVED',
    ADD COLUMN `approvedById` VARCHAR(191) NULL,
    ADD COLUMN `authorId` VARCHAR(191) NULL,
    ADD COLUMN `rejectionReason` TEXT NULL;

-- AlterTable
ALTER TABLE `User` ADD COLUMN `canManageContact` BOOLEAN NOT NULL DEFAULT false,
    ADD COLUMN `canManageGallery` BOOLEAN NOT NULL DEFAULT false,
    ADD COLUMN `canManageHome` BOOLEAN NOT NULL DEFAULT false,
    ADD COLUMN `canManagePages` BOOLEAN NOT NULL DEFAULT false,
    ADD COLUMN `canManagePosts` BOOLEAN NOT NULL DEFAULT false,
    ADD COLUMN `canManageVideos` BOOLEAN NOT NULL DEFAULT false;

-- AlterTable
ALTER TABLE `Video` ADD COLUMN `approvalStatus` ENUM('PENDING', 'APPROVED', 'REJECTED') NOT NULL DEFAULT 'APPROVED',
    ADD COLUMN `approvedById` VARCHAR(191) NULL,
    ADD COLUMN `authorId` VARCHAR(191) NULL,
    ADD COLUMN `rejectionReason` TEXT NULL;

-- AddForeignKey
ALTER TABLE `Post` ADD CONSTRAINT `Post_authorId_fkey` FOREIGN KEY (`authorId`) REFERENCES `User`(`id`) ON DELETE SET NULL ON UPDATE CASCADE;

-- AddForeignKey
ALTER TABLE `Post` ADD CONSTRAINT `Post_approvedById_fkey` FOREIGN KEY (`approvedById`) REFERENCES `User`(`id`) ON DELETE SET NULL ON UPDATE CASCADE;

-- AddForeignKey
ALTER TABLE `Video` ADD CONSTRAINT `Video_authorId_fkey` FOREIGN KEY (`authorId`) REFERENCES `User`(`id`) ON DELETE SET NULL ON UPDATE CASCADE;

-- AddForeignKey
ALTER TABLE `Video` ADD CONSTRAINT `Video_approvedById_fkey` FOREIGN KEY (`approvedById`) REFERENCES `User`(`id`) ON DELETE SET NULL ON UPDATE CASCADE;

-- AddForeignKey
ALTER TABLE `GalleryImage` ADD CONSTRAINT `GalleryImage_authorId_fkey` FOREIGN KEY (`authorId`) REFERENCES `User`(`id`) ON DELETE SET NULL ON UPDATE CASCADE;

-- AddForeignKey
ALTER TABLE `GalleryImage` ADD CONSTRAINT `GalleryImage_approvedById_fkey` FOREIGN KEY (`approvedById`) REFERENCES `User`(`id`) ON DELETE SET NULL ON UPDATE CASCADE;
