ALTER TABLE `KnowledgeItem` ADD COLUMN `learnable` BOOLEAN NOT NULL DEFAULT true;

CREATE TABLE IF NOT EXISTS `Artifact` (
    `id` VARCHAR(191) NOT NULL,
    `userId` VARCHAR(191) NOT NULL,
    `kbId` VARCHAR(191) NOT NULL,
    `type` VARCHAR(32) NOT NULL,
    `title` VARCHAR(255) NOT NULL,
    `configJson` JSON NULL,
    `status` VARCHAR(16) NOT NULL DEFAULT 'draft',
    `createdAt` DATETIME(3) NOT NULL DEFAULT CURRENT_TIMESTAMP(3),
    `updatedAt` DATETIME(3) NOT NULL,
    INDEX `Artifact_userId_idx`(`userId`),
    INDEX `Artifact_kbId_idx`(`kbId`),
    PRIMARY KEY (`id`)
) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
