feat: migrate from Supabase to direct PostgreSQL connection#10
Merged
Conversation
This major refactor replaces the Supabase client library with direct PostgreSQL connections for improved DDL permissions and database management flexibility. ### Database Infrastructure - **Migration System**: Added comprehensive database migration framework with baseline and incremental migrations - **PostgreSQL Client**: Implemented direct PostgreSQL connection using psycopg2-binary with context managers - **Schema Management**: Created migration runner with proper transaction handling and rollback support ### Updated Database Schema - **Meeting Model**: Added `updated_at` field with automatic timestamp triggers - **Persona System**: Integrated persona management with dedicated database table and CRUD operations - **Automatic Timestamps**: PostgreSQL triggers maintain `updated_at` fields on record modifications ### Repository Layer Rewrite - **Meeting Repository**: Converted all Supabase operations to raw SQL with parameterized queries - **Persona Repository**: New repository for persona management with full CRUD capabilities - **Data Models**: Enhanced Meeting and Persona models with proper datetime handling ### Migration Strategy - **Zero Data Loss**: Safe production deployment with data backfilling and ownership transfers - **Backward Compatibility**: Deprecated API functions maintain compatibility during transition - **Database Migrations**: Applied 003_add_updated_at_to_ymemo.sql successfully with 6 existing records preserved ### Dependencies - **Added**: psycopg2-binary>=2.9.10 for PostgreSQL connectivity - **Removed**: supabase>=2.0.0 client library dependency - **Configuration**: Updated environment handling for POSTGRES_URL connection string ### Testing & Documentation - **Test Suite**: All 275 tests pass with database independence (no PostgreSQL connection required) - **Documentation**: Updated CLAUDE.md with PostgreSQL configuration, migration commands, and architecture details - **Configuration**: Added comprehensive database operation commands and troubleshooting guide 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
🧪 YMemo CI/CD Results✅ Tests: success 📊 Test Summary
🎯 Quality StandardsYMemo maintains enterprise-grade quality with:
🎉 All systems go! This PR is ready for review. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This major refactor replaces the Supabase client library with direct PostgreSQL connections for improved DDL permissions and database management flexibility.
• Database Infrastructure: Added comprehensive migration framework with baseline and incremental migrations
• PostgreSQL Client: Implemented direct connection using psycopg2-binary with context managers and transaction handling
• Schema Enhancement: Added
updated_atfield to Meeting model with automatic timestamp triggers• Repository Rewrite: Converted all Supabase operations to raw SQL with parameterized queries
• Persona System: Integrated persona management with dedicated database table and CRUD operations
Migration Details
supabase>=2.0.0withpsycopg2-binary>=2.9.10Test Coverage
Test plan
🤖 Generated with Claude Code