← ClaudeAtlas

cli-database-operationslisted

Use when running database migrations, seeding data, backing up, or inspecting the database schema in a Lexigram project
dbtinoy-/lexigram-framework-skills · ★ 1 · API & Backend · score 72
Install: claude install-skill dbtinoy-/lexigram-framework-skills
# CLI Database Operations ## Overview `lexigram db` manages the full database lifecycle — migrations, seeding, schema inspection, and backup/restore — backed by `lexigram-sql`'s migration manager. All commands accept `--env/-e` to select the environment. ## Migration Lifecycle ```bash lexigram db init # Create migrations/ directory (arg: dir name) lexigram db migrate add_users_table # Generate a new migration file lexigram db create add_users_table # New empty migration (-m for description) lexigram db upgrade # Apply pending migrations lexigram db downgrade # Roll back the most recent lexigram db downgrade 0003_seed # Roll back to a specific version (positional arg) lexigram db status # Current version + pending lexigram db history --limit 20 # Last N applied migrations (-n) lexigram db validate # Check applied migrations have files ``` ## Seeding & Reset ```bash lexigram db seed # Run seeds/*.py scripts (arg: single file) lexigram db reset --seed # Drop + recreate + seed lexigram db reset --force # Skip confirmation prompt ``` Seed scripts live in `seeds/*.py`. ## Inspection & Administration ```bash lexigram db inspect # List tables lexigram db inspect --table users # One table's columns + types (-t) lexigram db shell # Open a DB client REPL lexigram db setup # Per-package schema set