CREATE TABLE IF NOT EXISTS `SourceReference` (
    `id` VARCHAR(191) NOT NULL,
    `sourceId` VARCHAR(191) NOT NULL,
    `chunkId` VARCHAR(191) NULL,
    `artifactType` VARCHAR(32) NOT NULL,
    `artifactId` VARCHAR(100) NOT NULL,
    `pageNumber` INT NULL,
    `sectionTitle` VARCHAR(500) NULL,
    `excerptText` VARCHAR(2000) NULL,
    `createdAt` DATETIME(3) NOT NULL DEFAULT CURRENT_TIMESTAMP(3),
    INDEX `SourceReference_artifactType_artifactId_idx`(`artifactType`, `artifactId`),
    INDEX `SourceReference_sourceId_idx`(`sourceId`),
    PRIMARY KEY (`id`)
) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
