validate
Check scripts for naming conventions, syntax, duplicates, and dependency errors.
Database required: No
Usage
bash
dbsh validate
dbsh validate --environment local
dbsh validate --json # for CIWhat it checks
- Naming: every file must match the
V/R/U+ version +__+ name convention - Syntax: scripts must not be empty or comment-only
- Duplicates: no two versioned scripts can share the same version number
- Dependencies: every
-- Depends:reference must point to an existing file - Parse errors: malformed filenames are flagged
Example output
Validating migration scripts...
Scripts checked: 16
Errors: 0
Warnings: 0
Validation passed.JSON output
bash
dbsh validate --jsonjson
{
"success": true,
"scriptsChecked": 16,
"errors": [],
"warnings": []
}When to run
- Before
planormigrate— catches issues early - In CI — fast, no database needed
- After editing existing scripts — detects checksum drift potential