{"record":{"id":"93c44c862f6999c9","repo":"payloadcms/payload","slug":"collectionslug-collection-global-not-fo-93c44c","errorCode":null,"errorMessage":"${collectionSlug ? 'Collection' : 'Global'} not found: ${collectionSlug || globalSlug}","messagePattern":"(.+?) not found: (.+?)","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/drizzle/src/postgres/predefinedMigrations/localize-status/index.ts","lineNumber":56,"sourceCode":"    throw new Error('Localization is not enabled in payload config')\n  }\n\n  // Check if versions are enabled on this collection/global\n  let entityConfig\n  if (collectionSlug) {\n    const collection = payload.config.collections.find((c) => c.slug === collectionSlug)\n    if (collection) {\n      entityConfig = collection\n    }\n  } else if (globalSlug) {\n    const global = payload.config.globals.find((g) => g.slug === globalSlug)\n    if (global) {\n      entityConfig = global\n    }\n  }\n\n  if (!entityConfig) {\n    throw new Error(\n      `${collectionSlug ? 'Collection' : 'Global'} not found: ${collectionSlug || globalSlug}`,\n    )\n  }\n\n  payload.logger.info({\n    msg: `Starting _status localization migration for ${collectionSlug ? 'collection' : 'global'}: ${entitySlug}`,\n  })\n\n  // Get filtered locales if filterAvailableLocales is defined\n  let locales = payload.config.localization.localeCodes\n  if (typeof payload.config.localization.filterAvailableLocales === 'function') {\n    const filteredLocaleObjects = await payload.config.localization.filterAvailableLocales({\n      locales: payload.config.localization.locales,\n      req,\n    })\n    locales = filteredLocaleObjects.map((locale) => locale.code)\n  }\n  payload.logger.info({ msg: `Locales: ${locales.join(', ')}` })","sourceCodeStart":38,"sourceCodeEnd":74,"githubUrl":"https://github.com/payloadcms/payload/blob/00c58b35c0ed348ddc22daabf467b139727214fd/packages/drizzle/src/postgres/predefinedMigrations/localize-status/index.ts#L38-L74","documentation":"Lookup error from `migratePostgresLocalizeStatus`: the supplied `collectionSlug`/`globalSlug` does not match any collection or global in `payload.config`. The migration derives the versions/locales table name from the slug, so an unknown slug has no schema to operate on.","triggerScenarios":"Passing a slug that is misspelled, has wrong casing, or refers to a collection/global not registered in the current config (e.g. from a plugin not loaded, or a renamed entity).","commonSituations":"Renaming a collection without updating the migration script argument; slug copied from an old config; plugin-provided collection whose plugin isn't loaded in the environment running the migration; camelCase vs kebab-case mismatch.","solutions":["Verify the exact slug in `payload.config` and pass that string (collection/global slugs are case-sensitive).","Ensure any plugin that registers the target collection/global is loaded in the config used by the migration.","If the entity was renamed, run the migration against its new slug."],"exampleFix":"// before\nawait migratePostgresLocalizeStatus({ collectionSlug: 'Post', ... }) // wrong case\n// after\nawait migratePostgresLocalizeStatus({ collectionSlug: 'posts', ... }) // matches config slug","handlingStrategy":"validation","validationCode":"const knownSlugs = new Set([\n  ...payload.config.collections.map(c => c.slug),\n  ...payload.config.globals.map(g => g.slug),\n])\nconst slug = collectionSlug ?? globalSlug\nif (!knownSlugs.has(slug)) {\n  throw new Error(`Unknown entity slug: ${slug}`)\n}\nawait migratePostgresLocalizeStatus(args)","typeGuard":"const isKnownSlug = (slug, payload) =>\n  payload.config.collections.some(c => c.slug === slug) ||\n  payload.config.globals.some(g => g.slug === slug)","tryCatchPattern":"null","preventionTips":["Derive migration targets from the live config rather than hardcoding.","Load all relevant plugins before running migrations."],"tags":["migrations","localization","config-lookup","predefined-migration"],"backgroundTag":null,"analyzedSha":"00c58b35c0ed348ddc22daabf467b139727214fd","analyzedAt":"2026-08-12T20:45:03.758Z","schemaVersion":2},"datasetVersion":"2026-08-12T23:17:12.415Z"}