{"id":"c0d361adf24656f6","repo":"drizzle-team/drizzle-orm","slug":"can-t-select-entitykind-generator-for-this-ve","errorCode":null,"errorMessage":"Can't select ${entityKind} generator for ${this.version} version.","messagePattern":"Can't select (.+?) generator for (.+?) version\\.","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"drizzle-seed/src/services/SeedService.ts","lineNumber":325,"sourceCode":"\t\tif (entityKind === 'GenerateArray') {\n\t\t\tconst oldBaseColumnGen = (generator as GenerateArray).params.baseColumnGen;\n\n\t\t\tconst newBaseColumnGen = this.selectVersionOfGenerator(oldBaseColumnGen);\n\t\t\t// newGenerator.baseColumnDataType = oldGenerator.baseColumnDataType;\n\n\t\t\t(generator as GenerateArray).params.baseColumnGen = newBaseColumnGen;\n\t\t}\n\n\t\tconst possibleGeneratorConstructors = generatorsMap[entityKind as keyof typeof generatorsMap];\n\n\t\tconst possibleGeneratorConstructorsFiltered = possibleGeneratorConstructors?.filter((possGenCon) =>\n\t\t\tpossGenCon.version <= this.version! // sorting in ascending order by version\n\t\t).sort((a, b) => a.version - b.version);\n\t\tconst generatorConstructor = possibleGeneratorConstructorsFiltered?.at(-1) as\n\t\t\t| (new(params: any) => AbstractGenerator<any>)\n\t\t\t| undefined;\n\t\tif (generatorConstructor === undefined) {\n\t\t\tthrow new Error(`Can't select ${entityKind} generator for ${this.version} version.`);\n\t\t}\n\n\t\tconst newGenerator = new generatorConstructor(generator.params);\n\t\tnewGenerator.baseColumnDataType = generator.baseColumnDataType;\n\t\tnewGenerator.isUnique = generator.isUnique;\n\t\t// TODO: for now only GenerateValuesFromArray support notNull property\n\t\tnewGenerator.notNull = generator.notNull;\n\t\tnewGenerator.dataType = generator.dataType;\n\t\tnewGenerator.stringLength = generator.stringLength;\n\n\t\treturn newGenerator;\n\t};\n\n\tcyclicTablesCompare = (\n\t\ttable1: Table,\n\t\ttable2: Table,\n\t\trelation: Relation & { isCyclic: boolean },\n\t\treverseRelation: Relation & { isCyclic: boolean } | undefined,","sourceCodeStart":307,"sourceCodeEnd":343,"githubUrl":"https://github.com/drizzle-team/drizzle-orm/blob/b7862528fd8fc39bc2653a6c18dad7c1f4e68d10/drizzle-seed/src/services/SeedService.ts#L307-L343","documentation":"selectVersionOfGenerator filters the registered generator constructors for a given entityKind by version <= this.version and picks the highest. If no constructor exists at or below the requested version (e.g. version is 1 but the generator was only introduced in version 2, or the entityKind has no registered constructors at all), the filtered list is empty and it throws.","triggerScenarios":"Setting options.version = 1 when a column resolves to a generator kind whose only implementation is version 2; or an internal/entityKind value that has no entry in generatorsMap.","commonSituations":"Downgrading the version option to force v1 behavior but a column type only has a v2 generator; using a custom or experimental generator whose entityKind isn't in the generatorsMap registry.","solutions":["Raise options.version to the latest (2) or omit it so the default is used.","If you intentionally need v1, switch the affected column to a generator kind that has a v1 implementation.","Register the missing generator constructor in generatorsMap under the entityKind and the target version (advanced / library-level fix)."],"exampleFix":"// before\nawait seed(db, { schema }, { version: 1 });\n// after\nawait seed(db, { schema }, { version: 2 }); // or omit version","handlingStrategy":"validation","validationCode":"function isValidSeedVersion(v: unknown): boolean {\n  return v === undefined || (typeof v === 'number' && !Number.isNaN(v) && v >= 1 && v <= 2);\n}\n// If using version 1, be aware some generators only exist in v2.\n// Omit version to get the safest default (latest).","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Omit options.version to use the latest stable generator implementations.","When pinning version 1, verify all column types have v1 generators available.","After upgrading drizzle-seed, review generatorsMap for version coverage."],"tags":["version","generator-registry","entity-kind"],"analyzedSha":"b7862528fd8fc39bc2653a6c18dad7c1f4e68d10","analyzedAt":"2026-08-03T18:11:14.318Z","schemaVersion":2}