jetbase validate-files¶
Check for missing migration files, out of order migrations, and if files have
Usage¶
Description¶
The validate-files command performs the following checks:
- Ensures every migration recorded in the database still has its corresponding SQL file (detects missing, deleted, or moved files)
- Warns if any new migration file has a lower version than those already migrated (out-of-order migrations)
- Verifies that all migration versions are unique (prevents duplicates)
For detailed explanations of these checks, see Validations.
Options¶
| Option | Short | Description |
|---|---|---|
--fix |
-f |
Remove database records for missing files |
Tip:
or the shortcut:
You can use eitherBoth commands are identical
Examples¶
Audit Mode (Default)¶
Check for missing files without making changes:
If all files exist:
If files are missing:
Fix Mode¶
Remove records of migrations whose files no longer exist:
Output:
Database Integrity¶
Missing files can indicate:
- Accidental deletions
- Incomplete git operations
- Merge conflicts that removed files
Team Coordination¶
Helps identify when:
- Someone forgot to commit new migrations
- Files were removed in a PR that shouldn't have been
What --fix Does¶
When you run validate-files --fix:
- Identifies migrations without corresponding files
- Removes those records from the database
- Reports what was removed
Warning
Using --fix means Jetbase will forget those migrations ever happened. The database changes from those migrations remain, but Jetbase won't track them anymore.
When to Use --fix¶
✅ Safe to fix when:
- The file was intentionally removed and won't be needed
- You're cleaning up after a failed experiment
❌ Don't fix when:
- You need to roll back those migrations later
- Other team members might have the files
- You're not sure why the files are missing