{"record":{"id":"2aa4da86e2b3e500","repo":"windmill-labs/windmill","slug":"no-data-table-named-name-in-this-project","errorCode":null,"errorMessage":"No data table named '${name}' in this project","messagePattern":"No data table named '(.+?)' in this project","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"frontend/src/lib/components/ImportSetupStep.svelte","lineNumber":636,"sourceCode":"\t\t\treusing = false\n\t\t\tworking = false\n\t\t}\n\t}\n\n\t$effect(() => {\n\t\tvoid load()\n\t})\n\n\t/**\n\t * The data table now exists — run the migrations that were skipped for it during the\n\t * import, which is the whole reason this step waits for the configuration.\n\t */\n\tasync function runMigrationsFor(name: string): Promise<void> {\n\t\tconst row = rows.find((r) => r.name === name)\n\t\t// Thrown, not returned: this also runs as the wizard's appended step, which reads a\n\t\t// resolved promise as \"the migrations ran\". Resolving for a name that matches no row\n\t\t// would report success over SQL that never executed.\n\t\tif (!row) throw new Error(`No data table named '${name}' in this project`)\n\t\tworking = true\n\t\trow.status = 'running'\n\t\ttry {\n\t\t\tfor (const m of row.migrations) await applyOneMigration(workspace, slug, m)\n\t\t\trow.status = 'done'\n\t\t\trow.error = undefined\n\t\t\t// One-shot, cleared by name rather than by reference: `load()` rebuilds the row\n\t\t\t// objects, so the one holding the flag when it fires may not be this one.\n\t\t\trow.justSaved = true\n\t\t\tsetTimeout(() => {\n\t\t\t\tconst current = rows.find((r) => r.name === name)\n\t\t\t\tif (current) current.justSaved = false\n\t\t\t}, 1500)\n\t\t} catch (e: any) {\n\t\t\trow.status = 'failed'\n\t\t\trow.error = e?.body ?? e?.message ?? String(e)\n\t\t\tsendUserToast(`Could not run the migrations for ${name}: ${row.error}`, true)\n\t\t\t// Rethrown, because this also runs as the wizard's last checklist step","sourceCodeStart":618,"sourceCodeEnd":654,"githubUrl":"https://github.com/windmill-labs/windmill/blob/e474e8803ce2ff5c2df09a58dab51d45f5c922ca/frontend/src/lib/components/ImportSetupStep.svelte#L618-L654","documentation":"runMigrationsFor resolves a data-table row by name from the wizard's rows list. It throws instead of returning because the function is also used as an appended wizard step, where a resolved promise is interpreted as 'migrations ran' — resolving for an unknown name would falsely report success over SQL that never executed.","triggerScenarios":"Calling runMigrationsFor(name) with a name that matches no row in `rows` — typically a stale retry button referencing a data table removed from the export, or a programmatic/step invocation with a wrong or renamed table name.","commonSituations":"Clicking 'retry' on a migration row after the export was re-imported with fewer/differently named tables; a customized wizard step passing a hard-coded table name; renamed data tables between hub project versions.","solutions":["Check the table name against the data tables listed in the import wizard (it must exactly match a row name)","Re-load the project export so `rows` reflects the current tables, then retry","If a custom step calls runMigrationsFor, update the name to the renamed/current table"],"exampleFix":"// before\nawait runMigrationsFor('users_old')\n// after\nif (rows.some(r => r.name === 'users')) await runMigrationsFor('users')\nelse sendUserToast(`No data table 'users' in this project`, true)","handlingStrategy":"validation","validationCode":"if (!rows.some(r => r.name === name)) {\n  throw new Error(`No data table named '${name}' in this project`)\n}","typeGuard":"function rowExists(rows: {name: string}[], name: string): boolean {\n  return rows.some((r) => r.name === name)\n}","tryCatchPattern":"try {\n  await runMigrationsFor(name)\n} catch (e) {\n  if (String(e.message).startsWith(\"No data table named\")) {\n    sendUserToast(e.message, true)\n  } else throw e\n}","preventionTips":["Only call runMigrationsFor with names present in the currently loaded rows list","Re-fetch the project export after any re-import so names stay current","Avoid hard-coded table names in custom wizard steps"],"tags":["wizard","migrations","data-tables"],"backgroundTag":"unknown-resource-name","analyzedSha":"e474e8803ce2ff5c2df09a58dab51d45f5c922ca","analyzedAt":"2026-09-03T12:38:19.024Z","contentChangedAt":"2026-09-03T12:38:19.024Z","schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}