Skip to content

Conversation

@elammertsma
Copy link
Collaborator

@elammertsma elammertsma commented Jan 29, 2026

Modify the upgrade function to prevent errors when creating the podcast_status ENUM type by wrapping the creation in a DO block that catches duplicate_object exceptions.

Description

The existence of the podcast_status in a database was causing a mandatory Alembic upgrade step (82) to fail during migration.

Motivation and Context

This specific upgrade (82) was not idempotent, essentially causing breaking migration issues for anyone using it. Now it is.

Screenshots

API Changes

  • This PR includes API changes

Change Type

  • Bug fix
  • New feature
  • Performance improvement
  • Refactoring
  • Documentation
  • Dependency/Build system
  • Breaking change
  • Other (specify):

Testing Performed

  • Tested locally
  • Manual/QA verification

Checklist

  • Follows project coding standards and conventions
  • Documentation updated as needed <-- in general, Alembic migration needs to be documented for installing updates
  • Dependencies updated as needed
  • No lint/build errors or new warnings
  • All relevant tests are passing

High-level PR Summary

This PR fixes a database migration issue by making the Alembic upgrade step 82 idempotent. The change wraps the podcast_status ENUM type creation in a PostgreSQL DO block that catches duplicate_object exceptions, preventing migration failures when the type already exists in the database.

⏱️ Estimated Review Time: 5-15 minutes

💡 Review Order Suggestion
Order File Path
1 surfsense_backend/alembic/versions/82_add_podcast_status_and_thread.py

Need help? Join our Discord

Analyze latest changes

Modify the upgrade function to prevent errors when creating the podcast_status ENUM type by wrapping the creation in a DO block that catches duplicate_object exceptions.
@vercel
Copy link

vercel bot commented Jan 29, 2026

@elammertsma is attempting to deploy a commit to the Rohan Verma's projects Team on Vercel.

A member of the Team first needs to authorize it.

Copy link

@recurseml recurseml bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review by RecurseML

🔍 Review performed on 5d5f9d3..1f1d513

✨ No bugs found, your code is sparkling clean

✅ Files analyzed, no issues (1)

surfsense_backend/alembic/versions/82_add_podcast_status_and_thread.py

@MODSetter MODSetter merged commit 6604920 into MODSetter:dev Jan 30, 2026
4 of 7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants