{"record":{"id":"7cf64579d6b4c532","repo":"ent/ent","slug":"universal-id-and-increment-start-annotation-are-mu","errorCode":null,"errorMessage":"universal id and increment start annotation are mutually exclusive","messagePattern":"universal id and increment start annotation are mutually exclusive","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"dialect/sql/schema/atlas.go","lineNumber":883,"sourceCode":"\t\t\tif et.Comment != \"\" {\n\t\t\t\tav.SetComment(et.Comment)\n\t\t\t}\n\t\t\tif err := a.aVColumns(et, av); err != nil {\n\t\t\t\treturn nil, err\n\t\t\t}\n\t\t\ts.AddViews(av)\n\t\t\tcontinue\n\t\t}\n\t\tat := schema.NewTable(et.Name)\n\t\tif et.Comment != \"\" {\n\t\t\tat.SetComment(et.Comment)\n\t\t}\n\t\ta.sqlDialect.atTable(et, at)\n\t\t// universalID is the old implementation of the global unique id, relying on a table in the database.\n\t\t// The new implementation is based on annotations attached to the schema. Only one can be enabled.\n\t\tswitch {\n\t\tcase a.universalID && et.Annotation != nil && et.Annotation.IncrementStart != nil:\n\t\t\treturn nil, errors.New(\"universal id and increment start annotation are mutually exclusive\")\n\t\tcase a.universalID && et.Name != TypeTable && len(et.PrimaryKey) == 1:\n\t\t\tr, err := a.pkRange(et)\n\t\t\tif err != nil {\n\t\t\t\treturn nil, err\n\t\t\t}\n\t\t\ta.sqlDialect.atIncrementT(at, r)\n\t\tcase et.Annotation != nil && et.Annotation.IncrementStart != nil:\n\t\t\ta.sqlDialect.atIncrementT(at, int64(*et.Annotation.IncrementStart))\n\t\t}\n\t\tif err := a.aColumns(et, at); err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tif err := a.aIndexes(et, at); err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\ts.AddTables(at)\n\t\tbyT[et] = at\n\t}","sourceCodeStart":865,"sourceCodeEnd":901,"githubUrl":"https://github.com/ent/ent/blob/69d5d4deb19599f129166634e09d33addcf3f2cc/dialect/sql/schema/atlas.go#L865-L901","documentation":"Configuration-consistency guard while building the atlas schema state: universalID is the legacy global-unique-id mechanism (backed by the ent_type table) while IncrementStart is the newer annotation-based mechanism, and enabling both would double-allocate id ranges. The error fires when a.universalID is true and an entity carries a non-nil IncrementStart annotation. The offending input is the entity type whose schema mixes both mechanisms.","triggerScenarios":"Thrown at dialect/sql/schema/atlas.go:883 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Pick one mechanism: either disable universal IDs (drop the universal-id option) and keep the IncrementStart annotation, or remove the entgql/increment-start annotation and rely on universalID.","If multiple entities are involved, locate the offending one from the schema annotations before the error position."],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"69d5d4deb19599f129166634e09d33addcf3f2cc","analyzedAt":"2026-09-03T16:51:39.799Z","contentChangedAt":"2026-09-03T16:51:39.799Z","schemaVersion":2},"datasetVersion":"2026-09-11T00:17:11.886Z"}