class AmberCLI::Documentation::DatabaseCommand

Overview

Database Management

The database command provides comprehensive database management capabilities powered by Micrate. It supports PostgreSQL, MySQL, and SQLite.

Usage

amber database [COMMAND] [options]

Available Commands

create

Creates the database specified in your configuration.

amber database create

drop

Drops the database (use with caution).

amber database drop

migrate

Runs all pending migrations to bring the database up to date.

amber database migrate

rollback

Rolls back the last migration.

amber database rollback

redo

Rolls back and re-runs the latest migration.

amber database redo

status

Shows the current migration status.

amber database status

version

Displays the current database version.

amber database version

seed

Runs the database seed file (db/seeds.cr).

amber database seed

Configuration

Database configuration is handled through environment-specific YAML files in the config/environments/ directory:

database_url: postgres://user:pass@localhost:5432/myapp_development

Supported Databases

Defined in:

amber_cli/documentation.cr