Modified run_migrations() to only process files matching pattern: \d{3}_*.sql
This prevents utility scripts (check_features.sql) and manually applied
migrations (v9c_*.sql) from being executed.
Only properly numbered migrations like 003_add_email_verification.sql
will be processed.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Added migration tracking and execution to db_init.py:
- Created schema_migrations table to track applied migrations
- Added run_migrations() to automatically apply pending SQL files
- Migrations from backend/migrations/*.sql are now applied on startup
This fixes the missing email verification columns (migration 003).
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Bug: db_init.py was importing migrate_to_postgres but not calling main().
Result: Migration appeared successful but no data was migrated (0 users).
Fix: Import and call migrate_to_postgres.main()
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Remove postgresql-client installation (causes 150s+ hangs due to network)
- Add db_init.py: Pure Python PostgreSQL checks using psycopg2-binary
- Simplify startup.sh: Call Python script instead of psql commands
- Build should now complete in <30s instead of hanging
This fixes the deployment timeout issue by avoiding APT network problems entirely.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>