801e6a050b
- Documentation archivée et réorganisée - Backend: Ajout tests, migrations, library service, rate limiting - Frontend: Suppression Flutter, focus sur interface web HTML/JS - Tailwind CSS ajouté pour le style - Améliorations UX et corrections bugs Generated with [Claude Code](https://claude.com/claude-code) via [Happy](https://happy.engineering) Co-Authored-By: Claude <noreply@anthropic.com> Co-Authored-By: Happy <yesreply@happy.engineering>
1.3 KiB
1.3 KiB
Quick Start - Database Migration
Apply the Migration
cd /opt/audiOhm/backend
# Option 1: Using the helper script
./run_migration.sh upgrade
# Option 2: Using Alembic directly
alembic upgrade head
Verify Migration Success
# Check current version
./run_migration.sh current
# Or using Alembic directly
alembic current
What Gets Created
Two new tables will be created:
- listening_history - Track listening records for users
- liked_tracks - User's favorite/liked tracks
Need Help?
# Show all available commands
./run_migration.sh help
# Or read the full guide
cat ALEMBIC_GUIDE.md
Revert if Needed
# Revert the migration
./run_migration.sh downgrade-1
# Or using Alembic
alembic downgrade -1
Check Tables in Database
sudo -u postgres psql spotify_le_2
\dt
\q
Important Notes
- Make sure PostgreSQL is running before applying migration
- The migration uses CASCADE deletes - deleting a user or track will automatically remove related history/likes
- The
liked_trackstable has a UNIQUE constraint to prevent duplicate likes - Both tables have optimized indexes for common queries
Status
✅ Migration file created and validated ✅ Ready to apply to database ✅ Full downgrade support included ✅ Documentation complete