getting an error trying to add an enum type in a p...
# prisma-client
m
getting an error trying to add an enum type in a postgres migration:
Copy code
Error: P3006

Migration `20211013101052_candidate_id_shouldnt_be_unique` failed to apply cleanly to the shadow database.
Error:
db error: ERROR: ALTER TYPE ... ADD cannot run inside a transaction block
   0: sql_migration_connector::flavour::postgres::sql_schema_from_migration_history
             at migration-engine/connectors/sql-migration-connector/src/flavour/postgres.rs:354
   1: sql_migration_connector::validate_migrations
             at migration-engine/connectors/sql-migration-connector/src/lib.rs:342
   2: migration_core::api::DevDiagnostic
             at migration-engine/core/src/api.rs:108
trying to run
ALTER TYPE "CandidateSource" ADD VALUE 'OTHER';
r
@Mischa 👋 This is currently not supported: https://github.com/prisma/prisma/issues/7251
m
Hm yeah saw that, although it says
On PostgreSQL 11 and earlier versions, Prisma Migrate fails to ALTER existing enums if more than one value is added at once in a single migration.
but we're only adding a single value in the migration, not sure if that makes a difference
j
It should work for one at a time so an issue with an example reproduction would help I think
💯 1
My colleague tells me
Hmm in that case it’s because 
ALTER TYPE
 can’t run inside a transaction, Did the user manually add a transaction block?
m
just using the auto-generated migration sql and running prisma migrate dev
👍 1
j
Then we will definitely try to reproduce if you can open an issue