Skip to content

Conversation

@CREDO23
Copy link
Contributor

@CREDO23 CREDO23 commented Jan 13, 2026

Description

  • Add migration 0 for initial schema setup
  • Make Alembic migrations idempotent

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
  • Dependencies updated as needed
  • No lint/build errors or new warnings
  • All relevant tests are passing

High-level PR Summary

This PR makes Alembic database migrations idempotent by adding existence checks before applying schema changes. Each migration now verifies that tables and enums exist before attempting to modify them, and checks that columns don't already exist before creating or renaming them. This allows migrations to be safely re-run on fresh databases or in cases where the schema is already in the desired state, preventing errors from duplicate operations.

⏱️ Estimated Review Time: 30-90 minutes

💡 Review Order Suggestion
Order File Path
1 surfsense_backend/alembic/versions/1_add_github_connector_enum.py
2 surfsense_backend/alembic/versions/5_remove_title_char_limit.py
3 surfsense_backend/alembic/versions/24_fix_null_chat_types.py
4 surfsense_backend/alembic/versions/34_add_podcast_staleness_detection.py
5 surfsense_backend/alembic/versions/10_update_chattype_enum_to_qna_report_structure.py
6 surfsense_backend/alembic/versions/49_migrate_old_chats_to_new_chat.py
7 surfsense_backend/alembic/versions/52_rename_llm_preference_columns.py
8 surfsense_backend/alembic/versions/55_rename_google_drive_connector_to_file.py

Need help? Join our Discord

Analyze latest changes

@vercel
Copy link

vercel bot commented Jan 13, 2026

@CREDO23 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 f3f661f..443e877

✨ No bugs found, your code is sparkling clean

✅ Files analyzed, no issues (8)

surfsense_backend/alembic/versions/10_update_chattype_enum_to_qna_report_structure.py
surfsense_backend/alembic/versions/1_add_github_connector_enum.py
surfsense_backend/alembic/versions/24_fix_null_chat_types.py
surfsense_backend/alembic/versions/34_add_podcast_staleness_detection.py
surfsense_backend/alembic/versions/49_migrate_old_chats_to_new_chat.py
surfsense_backend/alembic/versions/52_rename_llm_preference_columns.py
surfsense_backend/alembic/versions/55_rename_google_drive_connector_to_file.py
surfsense_backend/alembic/versions/5_remove_title_char_limit.py

@CREDO23 CREDO23 changed the title [IMPR] Make Alembic migrations idempotent [Improvement] Make Alembic migrations idempotent Jan 14, 2026
@CREDO23 CREDO23 changed the base branch from main to dev January 14, 2026 15:24
@MODSetter MODSetter merged commit cee1a8b into MODSetter:dev Jan 14, 2026
2 of 6 checks passed
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 443e877..924e621

✨ No bugs found, your code is sparkling clean

✅ Files analyzed, no issues (2)

surfsense_backend/alembic/versions/0_initial_schema.py
surfsense_backend/alembic/versions/1_add_github_connector_enum.py

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