CREATE TABLE `AppEventLog` (
    `id` INTEGER NOT NULL AUTO_INCREMENT,
    `shop` VARCHAR(191) NOT NULL,
    `source` VARCHAR(191) NOT NULL,
    `level` VARCHAR(191) NOT NULL,
    `eventType` VARCHAR(191) NOT NULL,
    `message` TEXT NULL,
    `payload` JSON NULL,
    `createdAt` DATETIME(3) NOT NULL DEFAULT CURRENT_TIMESTAMP(3),

    INDEX `AppEventLog_shop_createdAt_idx`(`shop`, `createdAt`),
    INDEX `AppEventLog_source_createdAt_idx`(`source`, `createdAt`),
    PRIMARY KEY (`id`)
) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
