Altering an Enum field using Alembic

后端 未结 10 1125
故里飘歌
故里飘歌 2020-12-12 21:32

How can I add an element to an Enum field in an alembic migration when using a version of PostgreSQL older than 9.1 (which adds the ALTER TYPE for enums)? This SO question e

10条回答
  •  [愿得一人]
    2020-12-12 21:51

    In straight SQL, this would work for Postgres, if the order of the things in your enum doesn't need to be exactly as above:

    ALTER TYPE status ADD value 'output_limit_exceeded' after 'timed_out'; 
    

提交回复
热议问题