Error6 reports
Fix DrizzleQueryError
in Payload CMS
✅ Solution
DrizzleQueryError in Payload CMS often arises from attempting to create enum types or tables that already exist in the database during migration. To fix this, carefully review your Drizzle schema and migration files, ensuring you're not creating duplicate enum types or tables. Employ conditional logic within your migrations to first check if the schema element exists before attempting to create it, or use `db.execute` to drop the existing enum/table before recreating it.
Related Issues
Real GitHub issues where developers encountered this error:
Vercel one-click deployment fails: Command "pnpm run ci" exited with 1Dec 11, 2025
Failed migration - `DrizzleQueryError: type "enum<any_enum>" already exists.`Nov 12, 2025
Migrations fail on enums that already existNov 12, 2025
Multi-tenant: tenant deletion fails with DrizzleQueryError — transaction aborted (Postgres)Nov 12, 2025
Error when using Local API to persist data during migrationNov 4, 2025
Timeline
First reported:Oct 15, 2025
Last reported:Dec 11, 2025
Need More Help?
View the full changelog and migration guides for Payload CMS
View Payload CMS Changelog