Generates an Ecto migration that installs PgFlowDashboard.
Usage
mix pgflow_dashboard.gen.migration
mix pgflow_dashboard.gen.migration --migrations-path priv/repo/migrationsOptions
--migrations-path- Path to the migrations directory. Defaults topriv/repo/migrations.
Generated Objects
This migration creates the pgflow_dashboard PostgreSQL schema with:
Views
runs_with_progress- Runs with calculated progress percentageworkers_with_load- Workers with current load metricsflow_stats- Flow-level statistics (24h)step_states_with_tasks- Step states with task counts
Functions
get_overview_metrics()- Returns dashboard overview metricslist_runs(...)- Paginated run listing with filterslist_workers(...)- Paginated worker listing with filterslist_flows(...)- Flow statistics
Requirements
The pgflow schema must already exist. Run pgflow migrations first if needed.
Versioning
PgFlowDashboard uses versioned migrations. When you upgrade the library, running migrations again will automatically apply any new versions. The current version is tracked via PostgreSQL comments.
Example
# Generate the migration
$ mix pgflow_dashboard.gen.migration
# Run the migration
$ mix ecto.migrate