fix-alembic-postgresql-enum-duplicate

Identify and resolve duplicate ENUM type creation in Alembic PostgreSQL migrations.

Updated May 15, 2026
One-click install
npx skills add https://github.com/ruskibeats/t1d --skill fix-alembic-postgresql-enum-duplicate
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: fix-alembic-postgresql-enum-duplicate
Source: https://github.com/ruskibeats/t1d/tree/main/.pi/skills-archive/fix-alembic-postgresql-enum-duplicate
Command: npx skills add https://github.com/ruskibeats/t1d --skill fix-alembic-postgresql-enum-duplicate

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires psycopg2, Alembic, and includes scripts (resource) components.

What problem does it solve?

This Skill addresses the issue of double creation of ENUM types in PostgreSQL with Alembic migrations, preventing the DuplicateObject error.

Core Features & Use Cases

  • Alembic ENUM Type Double-Creation: Solves issues related to Alembic migration ENUM conflicts causing DuplicateObject errors.
  • Migration Error Fixing: Provides guidance on identifying and correcting migrations that attempt to create the same ENUM type multiple times.
  • Fix Implementation: Offers instructions on modifying column definitions to avoid duplicate type creation.

Quick Start

Run the script fix_alembic_postgresql_enum_duplicate.py as part of your Alembic migration workflow.

Frequently Asked Questions about fix-alembic-postgresql-enum-duplicate

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

FAQPage Schema
Why does Alembic migration fail with psycopg2 DuplicateObject error on PostgreSQL ENUM types?

The psycopg2 DuplicateObject error occurs when Alembic attempts to create the same PostgreSQL ENUM type multiple times. This Skill identifies these double-creation conflicts and corrects column definitions to prevent duplicate ENUM generation.

How do I fix Alembic migration ENUM conflicts in PostgreSQL?

You can fix Alembic migration ENUM conflicts by running the `fix_alembic_postgresql_enum_duplicate.py` script as part of your workflow. It modifies column definitions to avoid duplicate ENUM type creation.

What causes double creation of ENUM types in Alembic PostgreSQL migrations?

Double creation of ENUM types is caused by incorrect handling of ENUM type definitions in Alembic migrations, where multiple scripts attempt to define the same PostgreSQL ENUM type, triggering a DuplicateObject error.

Do I need psycopg2 and Alembic to resolve PostgreSQL ENUM duplicate errors?

Yes, resolving PostgreSQL ENUM duplicate errors requires both psycopg2 and Alembic. This Skill operates within environments using Alembic with PostgreSQL to identify and correct duplicate ENUM type creation.

What is the best way to prevent DuplicateObject errors during PostgreSQL database migration with Alembic?

The best way to prevent DuplicateObject errors during PostgreSQL database migration is to ensure correct handling of ENUM type definitions. This Skill modifies column definitions to stop Alembic from attempting duplicate ENUM type creation.