admin管理员组

文章数量:1403522

I'm trying to implement PostgreSQL ENUM types properly in my SQLAlchemy models and Alembic migrations. I am stuck on this one specific part:

How do I handle creating the enum type in migrations before it's used in tables?

I want to keep SQL Alchemy as a single source of truth, so adding in ad-hoc migrations to fill in the gaps from SQL Alchemy definitions makes it very hard to maintain what the current schema is by looking at the code alone.

Thanks in advance

本文标签: pythonHandling PostgreSQL ENUM types in SQLAlchemy and Alembic migrationsStack Overflow