-- AlterTable
ALTER TABLE `db_courses_activities` ADD COLUMN `attempt` INTEGER NULL DEFAULT 1,
    ADD COLUMN `duration` DOUBLE NULL DEFAULT 1,
    ADD COLUMN `libraryActivityId` INTEGER NULL;

-- AlterTable
ALTER TABLE `db_courses_topics` ADD COLUMN `libraryTopicId` INTEGER NULL;

-- AlterTable
ALTER TABLE `db_library_activites` ADD COLUMN `attempt` INTEGER NULL DEFAULT 1,
    ADD COLUMN `duration` DOUBLE NULL DEFAULT 1;

-- AlterTable
ALTER TABLE `db_teacher_activites` ADD COLUMN `attempt` INTEGER NULL DEFAULT 1,
    ADD COLUMN `duration` DOUBLE NULL DEFAULT 1;

-- AddForeignKey
ALTER TABLE `db_courses_topics` ADD CONSTRAINT `db_courses_topics_libraryTopicId_fkey` FOREIGN KEY (`libraryTopicId`) REFERENCES `db_library_topics`(`id`) ON DELETE CASCADE ON UPDATE CASCADE;

-- AddForeignKey
ALTER TABLE `db_courses_activities` ADD CONSTRAINT `db_courses_activities_libraryActivityId_fkey` FOREIGN KEY (`libraryActivityId`) REFERENCES `db_library_activites`(`id`) ON DELETE CASCADE ON UPDATE CASCADE;
