{"record":{"id":"15f30a89833d24c6","repo":"hasura/graphql-engine","slug":"skipping-applying-migrations-on-database-s-enc","errorCode":null,"errorMessage":"skipping applying migrations on database '%s', encountered: \n%s","messagePattern":"skipping applying migrations on database '(.+?)', encountered: \n(.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"cli/commands/migrate_apply.go","lineNumber":315,"sourceCode":"\t\t\terrPath     *os.PathError\n\t\t\terrNotFound *errDatabaseMigrationDirectoryNotFound\n\t\t)\n\n\t\tswitch {\n\t\tcase errors.Is(err, migrate.ErrNoChange):\n\t\t\treturn \"nothing to apply on database: \" + o.Source.Name, nil\n\t\tcase errors.As(err, &errPath):\n\t\t\t// If Op is first, then log No migrations to apply\n\t\t\tif errPath.Op == \"first\" {\n\t\t\t\treturn \"nothing to apply on database: \" + o.Source.Name, nil\n\t\t\t}\n\t\tcase errors.As(err, &errNotFound):\n\t\t\t// check if the returned error is a directory not found error\n\t\t\t// ie might be because  a migrations/<source_name> directory is not found\n\t\t\t// if so skip this\n\t\t\treturn \"\", herrors.E(\n\t\t\t\top,\n\t\t\t\tfmt.Errorf(\n\t\t\t\t\t\"skipping applying migrations on database '%s', encountered: \\n%s\",\n\t\t\t\t\to.Source.Name,\n\t\t\t\t\terrNotFound.Error(),\n\t\t\t\t),\n\t\t\t)\n\t\t}\n\n\t\treturn \"\", herrors.E(\n\t\t\top,\n\t\t\tfmt.Errorf(\n\t\t\t\t\"skipping applying migrations on database '%s', encountered: \\n%w\",\n\t\t\t\to.Source.Name,\n\t\t\t\terr,\n\t\t\t),\n\t\t)\n\t}\n\n\tif len(o.Source.Name) == 0 && !o.EC.AllDatabases {","sourceCodeStart":297,"sourceCodeEnd":333,"githubUrl":"https://github.com/hasura/graphql-engine/blob/724551b9ae87845594ef0408cff0e50eb6c90dc5/cli/commands/migrate_apply.go#L297-L333","documentation":"While reading the migrations directory for a source, the error matched a directory-not-found error (errors.As errNotFound), meaning migrations/<source_name>/ does not exist. The CLI skips that database, returning the wrapped message rather than aborting the multi-database run.","triggerScenarios":"`hasura migrate apply` (often with --all-databases) where one tracked source has no local migrations directory, e.g. a database added on the server but never initialized locally.","commonSituations":"Adding a second database via console then running migrate apply before `hasura init`/migrate create for it; cloning a repo missing a migrations folder.","solutions":["This is informational — the database is skipped; create migrations to include it: `hasura migrate create X --database-name <name>`","Or remove the extra directory check by creating migrations/<source_name>/.gitkeep style structure via init","If the database should not be tracked, untrack it from metadata"],"exampleFix":null,"handlingStrategy":"fallback","validationCode":"test -d \"migrations/$DB\" || echo \"no migrations dir for $DB (will be skipped)\"","typeGuard":null,"tryCatchPattern":"if strings.Contains(err.Error(), \"skipping applying migrations\") { /* treat as non-fatal, continue */ }","preventionTips":["Create a migrations/<source>/ directory when adding new tracked databases","Filter --database-name lists to databases with local migrations"],"tags":["migrate-apply","missing-directory","skip"],"backgroundTag":"missing-migrations-directory","analyzedSha":"724551b9ae87845594ef0408cff0e50eb6c90dc5","analyzedAt":"2026-08-28T07:32:55.105Z","schemaVersion":2},"datasetVersion":"2026-08-28T11:17:15.048Z"}