akron db status

Display current schema and migration status information for your Akron project.

NEW COMMAND

akron db status

Display comprehensive information about your schema configuration, database state, and migration status.

Syntax

1akron db status

What It Shows

Status Information

  • • Current schema file location and validity
  • • Database provider and connection details
  • • Number of tables defined in schema
  • • Schema change detection (uncommitted changes)
  • • Applied migration count and list
  • • Pending migration count and preview

Example Outputs

Clean State (Up to Date)

When schema and database are synchronized:

1akron db status
Expected Output
📊 Akron Status
==================================================
Schema file: akron.json
Database: sqlite
URL: sqlite:///app.db
Tables: 3

✅ Schema is up to date

Applied migrations: 2
Pending migrations: 0

Uncommitted Schema Changes

When akron.json has been modified but migrations haven't been generated:

1akron db status
Expected Output
📊 Akron Status
==================================================
Schema file: akron.json
Database: postgresql
URL: postgres://user:***@localhost:5432/myapp
Tables: 5

⚠️  Schema has uncommitted changes
   Run 'akron db makemigrations' to generate migration

Applied migrations: 3
Pending migrations: 0

Pending Migrations

When migrations have been generated but not applied:

1akron db status
Expected Output
📊 Akron Status
==================================================
Schema file: akron.json
Database: mysql
URL: mysql://user:***@localhost:3306/ecommerce
Tables: 8

✅ Schema is up to date

Applied migrations: 5
Pending migrations: 2

📋 Pending migrations:
   • add_user_preferences.json
   • create_audit_log.json

Error States

When there are configuration or connection issues:

1akron db status
Expected Output
❌ No akron.json found. Run 'akron db init' first.

Or when database connection fails:

Expected Output
📊 Akron Status
==================================================
Schema file: akron.json
Database: postgresql
URL: postgres://user:***@localhost:5432/myapp
Tables: 3

❌ Error checking migration status: connection to server at "localhost" (127.0.0.1), port 5432 failed

Status Indicators

Schema Status

Schema is up to date

No uncommitted changes detected

⚠️

Schema has uncommitted changes

Run makemigrations to generate migration

Migration Status

📋

Pending migrations

Shows list of unapplied migration files

Error states

Configuration or connection issues

Information Details

Database Information

FieldDescriptionExample
Schema filePath to akron.json configurationakron.json
DatabaseDatabase provider typesqlite, mysql, postgresql, mongodb
URLConnection string (credentials masked)mysql://user:***@localhost:3306/db
TablesNumber of tables in schema5

Migration Counts

Applied migrations

Number of migrations successfully applied to the database, tracked in the _akron_migrations table.

Pending migrations

Migration files in .akron/ directory that haven't been applied yet.

Use Cases

Development Workflow

  • • Check if schema changes need migrations
  • • Verify migrations before applying
  • • Monitor development database state
  • • Debug migration issues

Production Monitoring

  • • Verify deployment migration status
  • • Check database synchronization
  • • Monitor schema consistency
  • • Troubleshoot connection issues

Security Considerations

🔒 Credential Protection

The status command automatically masks sensitive information in database URLs to prevent credential exposure in logs or console output.

Original URL:

mysql://admin:secret123@db.example.com:3306/prod

Displayed URL:

mysql://admin:***@db.example.com:3306/prod

Troubleshooting with Status

💡 Common Scenarios

Schema changes not reflected

Status shows "uncommitted changes" → Run akron db makemigrations

Database out of sync

Status shows pending migrations → Run akron db migrate

Connection issues

Error messages help identify database connectivity problems

Related Commands