{"record":{"id":"54dd63b704c22a8f","repo":"remix-run/remix","slug":"invalid-migration-directory-name-name-expecte","errorCode":null,"errorMessage":"Invalid migration directory name \"{name}\". Expected format YYYYMMDDHHmmss_name","messagePattern":"Invalid migration directory name \"(.+?)\"\\. Expected format YYYYMMDDHHmmss_name","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/data-table/src/lib/migrations/directory-name.ts","lineNumber":14,"sourceCode":"const migrationDirectoryPattern = /^(\\d{14})_(.+)$/\n\n/**\n * Parses a migration directory name into `{ id, name }`.\n *\n * Expected format: `YYYYMMDDHHmmss_name`.\n * @param name Migration directory basename.\n * @returns Parsed migration id and name.\n */\nexport function parseMigrationDirectoryName(name: string): { id: string; name: string } {\n  let match = name.match(migrationDirectoryPattern)\n\n  if (!match) {\n    throw new Error(\n      'Invalid migration directory name \"' + name + '\". Expected format YYYYMMDDHHmmss_name',\n    )\n  }\n\n  return {\n    id: match[1],\n    name: match[2],\n  }\n}\n","sourceCodeStart":1,"sourceCodeEnd":24,"githubUrl":"https://github.com/remix-run/remix/blob/9696913134be3a4423513d2775f7b31d6917c049/packages/data-table/src/lib/migrations/directory-name.ts#L1-L24","documentation":"A migration directory name failed to match the required `YYYYMMDDHHmmss_name` pattern. The id timestamp and the underscore-separated name are how migrations are ordered and identified, so malformed names are rejected.","triggerScenarios":"Calling parseMigrationDirectoryName with names like `my_migration`, `20240101_create_users` (missing time part), or `20240101120000` (missing underscore/name).","commonSituations":"Hand-creating migration folders instead of using the generator; renaming directories; using a truncated 8-digit date instead of the full 14-digit timestamp.","solutions":["Rename the directory to `YYYYMMDDHHmmss_name`, e.g. `20240101123045_create_users`.","Use the package's migration scaffolding command so names are generated correctly.","If renaming a recorded migration, also update the journal/registry entry or roll back first."],"exampleFix":"# before\nmigrations/01_create_users/\n\n# after\nmigrations/20240101123045_create_users/","handlingStrategy":"validation","validationCode":"let ok = /^\\d{14}_[a-zA-Z0-9_-]+$/.test(dirName)\nif (!ok) throw new Error('bad migration dir name: ' + dirName)","typeGuard":"function isValidMigrationDirectoryName(name: string): boolean {\n  return /^\\d{14}_[a-zA-Z0-9_-]+$/.test(name)\n}","tryCatchPattern":"try {\n  let parsed = parseMigrationDirectoryName(entry.name)\n} catch (error) {\n  if (error instanceof Error && error.message.includes('Invalid migration directory name')) {\n    continue // skip non-migration dirs like .DS_Store or __tests__\n  }\n  throw error\n}","preventionTips":["Always create migrations via the scaffolding command, never by hand.","Filter directory listings with the YYYYMMDDHHmmss_name regex before parsing."],"tags":["migrations","naming-convention","validation"],"backgroundTag":"invalid-migration-filename","analyzedSha":"9696913134be3a4423513d2775f7b31d6917c049","analyzedAt":"2026-08-27T19:55:01.024Z","schemaVersion":2},"datasetVersion":"2026-08-28T00:17:15.603Z"}