db-migrate

Apply and roll back Backend.AI database migrations for manager, accountmgr, and appproxy using Alembic.

662|179|Updated Oct 6, 2016
One-click install
npx skills add https://github.com/lablup/backend.ai --skill db-migrate-lablup
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: db-migrate
Source: https://github.com/lablup/backend.ai/tree/main/.claude/skills/db-migrate
Command: npx skills add https://github.com/lablup/backend.ai --skill db-migrate-lablup

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill enables applying and rolling back database migrations for Backend.AI components by orchestrating Alembic upgrades and downgrades.

Core Features & Use Cases

  • Upgrade or downgrade database schemas for manager, accountmgr, and appproxy.
  • Validate status before migrating to ensure consistency.
  • Roll back migrations safely with targeted revisions and backups when needed.
  • Use case: after pulling new migrations from source, apply pending changes to all relevant databases and verify via status checks.

Quick Start

  1. Check current status: /db-status --component=<component>
  2. Apply migrations: /db-migrate --component=<component> --direction=upgrade --target=head
  3. Verify status: /db-status --component=<component>

Frequently Asked Questions about db-migrate

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

FAQPage Schema
How do I apply database migrations for Backend.AI components safely?

To apply database migrations safely, use Alembic upgrades for manager, accountmgr, and appproxy databases, enforcing pre-flight checks to validate status and ensure consistency before applying pending changes to the target head revision.

Can I roll back an Alembic database migration to a specific revision?

Yes, you can rollback Alembic database migrations by performing targeted downgrades to a specific revision, ensuring safe and auditable schema reversions across manager, accountmgr, and appproxy databases when needed.

What is the best way to check database migration status before upgrading?

Checking database migration status before upgrading involves running pre-flight validation checks on the manager, accountmgr, and appproxy databases to verify consistency and identify pending schema changes prior to deployment.

Does Backend.AI support automated schema migrations across multiple databases?

Yes, Backend.AI supports automated schema migrations across multiple databases, orchestrating Alembic upgrade and downgrade operations for manager, accountmgr, and appproxy components while enforcing pre-flight checks for safe, auditable migrations.

When do I need to run database downgrade operations in Backend.AI?

Database downgrade operations are needed when rolling back schema changes after pulling new migrations, allowing targeted revisions and backups to safely revert manager, accountmgr, and appproxy databases to a previous consistent state.

Are pre-flight checks required before applying Backend.AI database migrations?

Yes, pre-flight checks are required before applying Backend.AI database migrations to validate current database status, enforce consistency, and ensure safe, auditable upgrade and downgrade operations across all relevant components.