Database Management

Automate PostgreSQL migrations, SCD Type 2 versioning, and Closure Table setups with Alembic/SQLModel.

6|1|Updated Dec 12, 2019
One-click install
npx skills add https://github.com/ikeniborn/familyBudget --skill database-management-ikeniborn
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: Database Management
Source: https://github.com/ikeniborn/familyBudget/tree/main/.claude/skills/db-management
Command: npx skills add https://github.com/ikeniborn/familyBudget --skill database-management-ikeniborn

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Automates database administration tasks, including migrations, SCD Type 2 versioning, and Closure Table structures, reducing manual overhead and potential human errors.

Core Features & Use Cases

  • Alembic-based migrations for PostgreSQL 16+ and safe upgrade/downgrade workflows
  • SCD Type 2 pattern for dimension tables (historical tracking)
  • Closure Table structures for fast hierarchical queries
  • Production-safe migration templates and guidance for safe deployments
  • End-to-end workflow from model changes to migrations with validation

Quick Start

Create a new Alembic migration for a schema change and run upgrade to verify the changes.

Frequently Asked Questions about Database Management

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

FAQPage Schema
How do I automate database migrations with Alembic and SQLModel for PostgreSQL?

You can automate database migrations by using Alembic-based templates to generate schema changes and execute safe upgrade and downgrade workflows for PostgreSQL 16+ projects using SQLModel.

What is SCD Type 2 versioning and how does it handle historical data tracking?

SCD Type 2 versioning is a pattern for dimension tables that tracks historical data changes by creating new versions of records, enabling accurate historical tracking within your database schema.

How do I set up a closure table for hierarchical data queries in PostgreSQL?

You can set up a closure table using provided templates and commands to structure hierarchical data, enabling fast and efficient hierarchical queries within your PostgreSQL database environment.

Do I need async SQLAlchemy to use these SCD Type 2 and closure table templates?

Yes, you need async SQLAlchemy along with PostgreSQL 16+, Alembic 1.13+, and SQLModel to properly run the migration templates and manage SCD Type 2 and closure table structures.

What is the best way to manage schema changes in shared-budget database environments?

The best way to manage schema changes in shared-budget environments is using production-safe migration templates that provide validation and guidance for secure deployments alongside Alembic workflows.

Can I downgrade PostgreSQL schemas safely after applying these Alembic migrations?

Yes, you can downgrade schemas safely because the Alembic-based migrations provide structured upgrade and downgrade workflows designed to prevent manual overhead and human errors during reversals.