最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

python - Handling PostgreSQL ENUM types in SQLAlchemy and Alembic migrations - Stack Overflow

programmeradmin7浏览0评论

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

发布评论

评论列表(0)

  1. 暂无评论