{"record":{"id":"a13da5bc9995537b","repo":"hasura/graphql-engine","slug":"no-migration-files-found","errorCode":null,"errorMessage":"no migration files found","messagePattern":"no migration files found","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"cli/migrate/migrate.go","lineNumber":46,"sourceCode":"\tlog \"github.com/sirupsen/logrus\"\n\t\"golang.org/x/term\"\n)\n\n// DefaultPrefetchMigrations sets the number of migrations to pre-read\n// from the source. This is helpful if the source is remote, but has little\n// effect for a local source (i.e. file system).\n// Please note that this setting has a major impact on the memory usage,\n// since each pre-read migration is buffered in memory. See DefaultBufferSize.\nvar DefaultPrefetchMigrations = uint64(10)\n\n// DefaultLockTimeout sets the max time a database driver has to acquire a lock.\nvar DefaultLockTimeout = 15 * time.Second\n\nvar (\n\tErrNoChange         = errors.New(\"no change\")\n\tErrNilVersion       = errors.New(\"no migration\")\n\tErrLocked           = errors.New(\"database locked\")\n\tErrNoMigrationFiles = errors.New(\"no migration files found\")\n\tErrLockTimeout      = errors.New(\"timeout: can't acquire database lock\")\n\tErrApplied          = errors.New(\"Version already applied in database\")\n\tErrNotApplied       = errors.New(\"Migration not applied in database\")\n\tErrNoMigrationMode  = errors.New(\"Migration mode is disabled\")\n\tErrMigrationMode    = errors.New(\"Migration mode is enabled\")\n)\n\nconst (\n\tapplyingMigrationsMessage = \"Applying migrations\"\n)\n\nfunc newProgressBar(str string, w io.Writer, pbLogs bool) *pb.ProgressBar { //nolint:unparam\n\t// Default behaviour in non-interactive mode\n\tif !pbLogs && !term.IsTerminal(int(os.Stdout.Fd())) {\n\t\treturn nil\n\t}\n\t// bar template configuration\n\tstr = fmt.Sprintf(`\"%v: \"`, str)","sourceCodeStart":28,"sourceCodeEnd":64,"githubUrl":"https://github.com/hasura/graphql-engine/blob/724551b9ae87845594ef0408cff0e50eb6c90dc5/cli/migrate/migrate.go#L28-L64","documentation":"ErrNoMigrationFiles indicates that the migrations directory contains no migration files. It is returned early when an operation requires at least one migration but none were found.","triggerScenarios":"Running apply/create-based flows (e.g. Squash, status) when the migrations directory is empty or the configured directory path is wrong.","commonSituations":"New project where no migrations were created yet, wrong --dir flag, running from a directory without a migrations/ folder.","solutions":["Create at least one migration first (`hasura migrate create`)","Check the migrations directory path/config","Ensure you run the CLI from the Hasura project root"],"exampleFix":null,"handlingStrategy":"validation","validationCode":"entries, _ := os.ReadDir(migrationsDir)\nif len(entries) == 0 { return fmt.Errorf(\"no migrations; create one first\") }","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Check migrations directory is non-empty before running squash/apply flows","Run CLI from the project root or pass --dir explicitly"],"tags":["hasura","migration","missing-files"],"backgroundTag":"no-migration-files-found","analyzedSha":"724551b9ae87845594ef0408cff0e50eb6c90dc5","analyzedAt":"2026-08-28T07:32:55.105Z","schemaVersion":2},"datasetVersion":"2026-08-28T11:17:15.048Z"}