Files
AudiOhm/backend/QUICK_START_MIGRATION.md
T
root 801e6a050b prod: UI Optimisée mise en production
- 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>
2026-01-20 09:56:39 +00:00

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:

  1. listening_history - Track listening records for users
  2. 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_tracks table 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