Files
pgsql-jellyfin/docs/QUICK_PUBLISH_REFERENCE.md
wjones 1abf61a05f Add PostgresSubprocessException and refactor database initialization logic
- Introduced PostgresSubprocessException to handle errors during PostgreSQL subprocess execution.
- Refactored PostgresDatabaseProvider to improve schema initialization script discovery.
- Enhanced error handling for psql command execution, including logging of output and errors.
- Implemented methods to find the schema initialization script and the psql executable path.
2026-07-08 11:53:36 -04:00

2.3 KiB

🚀 Quick Reference: Publish Jellyfin with SQL Files

One Command Solution

.\publish-with-sql.ps1

That's it! Everything is handled automatically.


What Gets Published

publish/
├── jellyfin.exe
├── ... (all DLLs and files)
└── sql/                                    ← SQL files included!
    ├── all_performance_indexes.sql         ← Main performance script
    ├── add_base_performance_indexes.sql
    ├── diagnostics.sql
    └── schema_init/
        └── 10_create_supplementary_indexes.sql

Verify After Publish

# Check if SQL files are present
Test-Path "Jellyfin.Server\bin\Release\net11.0\publish\sql\all_performance_indexes.sql"
# Returns: True ✅

# List all SQL files
ls "Jellyfin.Server\bin\Release\net11.0\publish\sql" -Recurse

Manual Method (If Needed)

# 1. Publish
dotnet publish Jellyfin.Server\Jellyfin.Server.csproj -c Release

# 2. Copy SQL files
.\copy-sql-files.ps1

What Happens on Startup

Jellyfin starts
    ↓
Checks if performance indexes exist
    ↓
Missing? → Loads sql/all_performance_indexes.sql
    ↓
Creates 23 performance indexes automatically
    ↓
✅ Database optimized!

Logs You'll See

[INF] Found 0/9 base performance indexes. Applying SQL script...
[INF] Executing performance indexes script: .../sql/all_performance_indexes.sql
[INF] Performance indexes created successfully. Database is now fully optimized.

Files Created for You

  1. publish-with-sql.ps1 - Automated publish + copy script
  2. copy-sql-files.ps1 - Manual copy script
  3. scripts/sql/ - SQL files directory

Troubleshooting

SQL files not in publish output?

# Run the publish script
.\publish-with-sql.ps1

Already published without SQL files?

# Just copy them
.\copy-sql-files.ps1

Need to verify?

# Check the files
dir "Jellyfin.Server\bin\Release\net11.0\publish\sql"

Quick Test

# 1. Publish
.\publish-with-sql.ps1

# 2. Run
cd Jellyfin.Server\bin\Release\net11.0\publish
.\jellyfin.exe

# 3. Check logs - should see "Performance indexes created successfully"

That's all you need to know! 🎉

Use .\publish-with-sql.ps1 and you're done!