{"record":{"id":"be0d2d31b39506ac","repo":"Budibase/budibase","slug":"a-column-type-has-changed","errorCode":null,"errorMessage":"A column type has changed.","messagePattern":"A column type has changed\\.","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/server/src/sdk/workspace/tables/external/index.ts","lineNumber":56,"sourceCode":"const DEFAULT_PRIMARY_COLUMN = \"id\"\n\nfunction noPrimaryKey(table: Table) {\n  return table.primary == null || table.primary.length === 0\n}\n\nfunction validate(table: Table, oldTable?: Table) {\n  if (\n    !oldTable &&\n    table.schema[DEFAULT_PRIMARY_COLUMN] &&\n    noPrimaryKey(table)\n  ) {\n    throw new Error(\n      \"External tables with no `primary` column set will define an `id` column, but we found an `id` column in the supplied schema. Either set a `primary` column or remove the `id` column.\"\n    )\n  }\n\n  if (hasTypeChanged(table, oldTable)) {\n    throw new Error(\"A column type has changed.\")\n  }\n\n  const autoSubTypes = Object.values(AutoFieldSubType)\n  // check for auto columns, they are not allowed\n  for (let [key, column] of Object.entries(table.schema)) {\n    // this column is a special case, do not validate it\n    if (key === DEFAULT_PRIMARY_COLUMN) {\n      continue\n    }\n    // the auto-column type should never be used\n    if (column.type === FieldType.AUTO) {\n      throw new Error(\n        `Column \"${key}\" has type \"${FieldType.AUTO}\" - this is not supported.`\n      )\n    }\n\n    if (\n      column.subtype &&","sourceCodeStart":38,"sourceCodeEnd":74,"githubUrl":"https://github.com/Budibase/budibase/blob/a81a902e9a8fe55b467d106765f6638f12e35c49/packages/server/src/sdk/workspace/tables/external/index.ts#L38-L74","documentation":"Error \"A column type has changed.\" thrown in Budibase/budibase.","triggerScenarios":"Thrown at packages/server/src/sdk/workspace/tables/external/index.ts:56 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"a81a902e9a8fe55b467d106765f6638f12e35c49","analyzedAt":"2026-08-29T01:03:10.972Z","schemaVersion":2},"datasetVersion":"2026-08-29T02:17:18.158Z"}