migrations-api-reference

Document AsyncMigrationManager API and pgdbm migration file formats.

Updated Jul 28, 2025
One-click install
npx skills add https://github.com/juanre/pgdbm --skill migrations-api-reference
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: migrations-api-reference
Source: https://github.com/juanre/pgdbm/tree/main/skills/migrations-api-reference
Command: npx skills add https://github.com/juanre/pgdbm --skill migrations-api-reference

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill provides a comprehensive API reference for the pgdbm migrations subsystem, detailing AsyncMigrationManager usage and migration file formats to accelerate development and reduce guesswork.

Core Features & Use Cases

  • Complete API surface: Covers initialization, core methods, file formats, and history checks for migrations.
  • Migration workflow guidance: Demonstrates end-to-end workflows for single-service and multi-service setups, including module_name isolation.
  • Developer-focused examples: Includes practical code snippets and usage scenarios to speed up integration and validation.

Quick Start

Create and configure a MigrationManager for your module, then call apply_pending_migrations to apply available migrations. For example, initialize AsyncDatabaseManager, build AsyncMigrationManager with a module_name, and execute migrations.

Frequently Asked Questions about migrations-api-reference

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

FAQPage Schema
How do I apply pending migrations in a PostgreSQL database using pgdbm?

Initialize AsyncDatabaseManager, build AsyncMigrationManager with your module_name, then call apply_pending_migrations to execute available migrations. This ensures safe, reproducible schema changes across your PostgreSQL database.

What is the correct format for pgdbm migration files?

Migration files use template-based syntax with required module_name isolation. File naming conventions, initialization patterns, and core method signatures are enforced to maintain consistency. The API reference details exact naming conventions and template structure for single and multi-service setups.

Can I use pgdbm migrations across multiple services?

Yes, pgdbm supports multi-service setups through module_name isolation. Each service maintains separate migration contexts, preventing conflicts. The API reference provides complete workflow guidance and code examples for multi-service migration architectures.

How do I check migration history with AsyncMigrationManager?

AsyncMigrationManager includes built-in methods for history checks, allowing you to review applied migrations and their status. The API reference covers all core methods needed to inspect and validate migration state.

What setup is required before using AsyncMigrationManager?

You need AsyncDatabaseManager initialized with your PostgreSQL connection and a configured AsyncMigrationManager instance with a valid module_name. The Quick Start section provides initialization patterns for immediate integration.