brokle-migration-workflow

Manage PostgreSQL and ClickHouse migrations via a CLI workflow.

3|2|Updated Sep 4, 2025
One-click install
npx skills add https://github.com/brokle-ai/brokle --skill brokle-migration-workflow
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: brokle-migration-workflow
Source: https://github.com/brokle-ai/brokle/tree/main/.claude/skills/brokle-migration-workflow
Command: npx skills add https://github.com/brokle-ai/brokle --skill brokle-migration-workflow

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill provides comprehensive guidance for managing database migrations in Brokle, covering both PostgreSQL and ClickHouse, ensuring schema evolution is smooth, safe, and consistent. It prevents database-related downtime and errors.

Core Features & Use Cases

  • Migration CLI: Explains how to use the migration CLI for up, down, status, and create operations across different databases.
  • Schema Guidelines: Provides best practices for designing PostgreSQL (transactional) and ClickHouse (analytics) schemas, including TTL, partitioning, and compression.
  • Seeding Data: Guides on creating and running seed files for development, demo, and testing environments, ensuring consistent data setups.
  • Use Case: A developer needs to add a new table to PostgreSQL and a new analytics table to ClickHouse. This skill provides the exact SQL templates, CLI commands, and safety checklists to ensure the migrations are correctly created, applied, and can be rolled back if needed.

Quick Start

I need to create a new PostgreSQL migration to add a features table and a ClickHouse migration for event_logs. Provide the SQL templates for both up and down migrations.

Frequently Asked Questions about brokle-migration-workflow

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I create and apply database migrations for PostgreSQL and ClickHouse?

Database migrations manage schema changes across PostgreSQL and ClickHouse. Use the migration CLI with `up` and `down` commands to create new migrations, apply them safely to development or production, and roll back if needed. The Skill provides SQL templates and step-by-step CLI workflows for both databases.

What's the best way to add a new table to PostgreSQL and ClickHouse simultaneously?

Design migrations separately for PostgreSQL (transactional) and ClickHouse (analytics). Use the migration CLI to create paired migrations with matching `up` and `down` SQL. The Skill provides schema templates, partitioning guidance, and safety checklists to ensure consistent deployment across both databases.

How do I seed data in PostgreSQL and ClickHouse for testing and development?

Seed files populate consistent test data in development, demo, and staging environments. Create seed files using the migration CLI, then run them alongside schema migrations. The Skill covers seed file creation, execution order, and environment-specific data setup.

Can I preview migrations before applying them to production?

Yes, dry-run previews show exactly what a migration will execute without committing changes. Use the migration CLI's dry-run feature to review SQL changes, check for conflicts, and validate safety before production deployment.

What precautions should I take when rolling back migrations in production?

Rollback guards and health checks prevent data loss during reversions. The Skill provides dirtiness detection, status checks, and step-by-step rollback procedures. Always validate `down` migrations in staging before production use, and confirm database state before executing.

Does the migration workflow support both development and production environments?

Yes, the CLI-driven workflow applies migrations across development, staging, and production with granular database selection and safety confirmations. Each environment uses the same migration files with environment-specific execution controls and status monitoring.