Tools Reference

Tools: Data & Migrations

Data tools manage database schema migrations, seed data, and direct database inspection and querying.


zeeb_create_migration

Auto-detect model changes and generate an Alembic migration file.

zeeb_create_migration(name?, project_id) → str

Arguments:

NameTypeDescription
namestring?Optional migration name (e.g. create_posts)
project_idstringUUID of the target project

Runs zeeb-manage makemigrations inside the project. Detects all pending model changes across apps.

Example prompt: "Create a migration for the blog app changes"


zeeb_run_migrations

Apply all pending migrations to bring the database schema up to date.

zeeb_run_migrations(target?, project_id) → str

Arguments:

NameTypeDescription
targetstring?Target revision (default: head — latest)
project_idstringUUID of the target project

Runs zeeb-manage migrate.


zeeb_get_migration_status

Show applied and pending migrations.

zeeb_get_migration_status(project_id) → str

Returns: List of all migrations with their applied/pending status.


zeeb_rollback_migration

Roll back to a specific migration revision.

zeeb_rollback_migration(target: str, project_id) → str

Arguments:

NameTypeDescription
targetstringTarget revision to roll back to
project_idstringUUID of the target project

zeeb_seed_data

Generate a seed.py script that populates the database with sample data.

zeeb_seed_data(app, model, count?, field_defaults?, project_id) → str

Arguments:

NameTypeDescription
appstringApp name
modelstringModel class name
countintNumber of records to seed (default: 10)
field_defaultsdict?Fixed field values (e.g. {"status": "active"})
project_idstringUUID of the target project

Creates <app>/seed.py with a runnable seed script.


zeeb_list_tables

List all database tables in the project.

zeeb_list_tables(project_id) → str

Returns: Array of table names currently in the database.


zeeb_describe_table

Get the column schema for a specific table.

zeeb_describe_table(table_name: str, project_id) → str

Returns: Column names, types, nullability, defaults, and constraints.


zeeb_run_query

Execute a raw SQL query against the project database.

zeeb_run_query(sql: str, project_id) → str

Arguments:

NameTypeDescription
sqlstringSQL query to execute
project_idstringUUID of the target project

⚠️ Destructive queries (DROP, TRUNCATE, DELETE without WHERE) are allowed — use with care.

Example prompt: "Show me the 10 most recent posts from the database"


Notes

  • Migrations use Alembic under the hood via zeeb_orm.
  • zeeb_run_migrations must be called after every zeeb_create_migration to apply changes.
  • zeeb_seed_data generates a script file; to run it, use zeeb_run_management_command with seed <app>.