{"record":{"id":"68da71227c8f37d0","repo":"payloadcms/payload","slug":"collectionslug-collection-global-not-fo-68da71","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/sqlite/predefinedMigrations/localize-status/index.ts","lineNumber":48,"sourceCode":"  const versionsTable = collectionSlug\n    ? `_${toSnakeCase(collectionSlug)}_v`\n    : `_${toSnakeCase(globalSlug)}_v`\n  const localesTable = `${versionsTable}_locales`\n\n  if (!payload.config.localization) {\n    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    entityConfig = payload.config.collections.find((c) => c.slug === collectionSlug)\n  } else if (globalSlug) {\n    entityConfig = payload.config.globals.find((g) => g.slug === globalSlug)\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) =>\n      typeof locale === 'string' ? locale : locale.code,\n    )","sourceCodeStart":30,"sourceCodeEnd":66,"githubUrl":"https://github.com/payloadcms/payload/blob/00c58b35c0ed348ddc22daabf467b139727214fd/packages/drizzle/src/sqlite/predefinedMigrations/localize-status/index.ts#L30-L66","documentation":"Thrown by migrateSqliteLocalizeStatus when the supplied collectionSlug is not found in payload.config.collections, or the supplied globalSlug is not found in payload.config.globals. The migration looks up the entity config to read its versions settings; a missing slug means there is nothing to migrate.","triggerScenarios":"Passing a collectionSlug or globalSlug that is misspelled, has been renamed, or belongs to a different payload instance/config than the one passed in `payload`.","commonSituations":"Slug renamed in config but the migration script still uses the old slug; pointing the migration at a payload object whose config does not include the target collection/global.","solutions":["Confirm the slug matches the `slug` field of a collection or global in the payload config you passed.","If the entity was renamed, update the migration call to the new slug.","Run the migration against the payload instance whose config actually defines that entity."],"exampleFix":"// before\nawait migrateSqliteLocalizeStatus({ db, payload, collectionSlug: 'post' }) // slug is 'posts'\n// after\nawait migrateSqliteLocalizeStatus({ db, payload, collectionSlug: 'posts' })","handlingStrategy":"validation","validationCode":"function assertEntityExists(payload, args) {\n  const exists = args.collectionSlug\n    ? payload.config.collections.some(c => c.slug === args.collectionSlug)\n    : payload.config.globals.some(g => g.slug === args.globalSlug)\n  if (!exists) throw new Error(`Unknown slug: ${args.collectionSlug || args.globalSlug}`)\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Derive migration target slugs from payload.config at runtime rather than hard-coding them.","Re-run the migration after syncing config changes across environments."],"tags":["migration","sqlite","localization","configuration"],"backgroundTag":null,"analyzedSha":"00c58b35c0ed348ddc22daabf467b139727214fd","analyzedAt":"2026-08-12T20:45:03.758Z","schemaVersion":2},"datasetVersion":"2026-08-12T23:17:12.415Z"}