1

I am trying to add a new value to an enumeration in Liquibase. I was using:

<changeSet id="update_status_enum_type_add_expired" >
    <sql>ALTER TYPE status ADD VALUE 'Expired';</sql>
</changeSet>

But I get

"ERROR: ALTER TYPE ... ADD cannot run inside a transaction block"

Any idea how to work it out?

Xbreizh
  • 333
  • 4
  • 19
  • 1
    Try to specify `runInTransaction="false"` in the `changeSet` –  Mar 15 '21 at 12:47
  • works great, thx. I also found that solution https://stackoverflow.com/a/56376907/10218144 which works fine too, only more verbose. Would there be any concern if performing that update out of a transaction? – Xbreizh Mar 15 '21 at 13:00

1 Answers1

1

Used as suggested in the comments:

<changeSet id="update_status_enum_type_add_expired" author="Team" runInTransaction="false">
    <sql>ALTER TYPE job_status ADD VALUE 'Expired';</sql>
</changeSet>
Xbreizh
  • 333
  • 4
  • 19