9bcb8501ab
- Introduced `publish-with-sql.ps1` to publish Jellyfin with SQL files. - Added `remove-sqlite.ps1` to facilitate the removal of SQLite dependencies for PostgreSQL-only deployment. - Created `rollback-to-net10.ps1` to revert .NET 11 changes back to .NET 10. - Implemented `test_api.py` for testing API interactions. - Added `verify-migration.ps1` to verify PostgreSQL migration steps. - Updated various `.csproj` files to include `Microsoft.Kiota.Abstractions` package. - Enhanced `JellyfinDbContext` to handle concurrency exceptions during save operations. - Updated tests to include new package references and ensure compatibility with changes.
58 lines
1.8 KiB
PowerShell
58 lines
1.8 KiB
PowerShell
# Database Configuration
|
|
# Edit this file to change which database commands run against
|
|
|
|
# Database connection settings
|
|
$PSQL_PATH = "C:\Program Files\PostgreSQL\18\bin\psql.exe"
|
|
$DB_USER = "jellyfin"
|
|
$DB_NAME = "jellyfin_test2" # ← Change this to switch databases
|
|
$DB_HOST = "192.168.129.253"
|
|
$DB_PORT = "6432"
|
|
|
|
# Export for use in other scripts
|
|
$global:PSQL_PATH = $PSQL_PATH
|
|
$global:DB_USER = $DB_USER
|
|
$global:DB_NAME = $DB_NAME
|
|
$global:DB_HOST = $DB_HOST
|
|
$global:DB_PORT = $DB_PORT
|
|
|
|
# Helper function to run psql commands
|
|
function Invoke-PSQL {
|
|
param(
|
|
[string]$Query,
|
|
[string]$File,
|
|
[string]$OutputFile
|
|
)
|
|
|
|
$baseCmd = "& `"$PSQL_PATH`" -h $DB_HOST -p $DB_PORT -U $DB_USER -d $DB_NAME"
|
|
|
|
if ($File) {
|
|
$cmd = "$baseCmd -f `"$File`""
|
|
} elseif ($Query) {
|
|
$cmd = "$baseCmd -c `"$Query`""
|
|
} else {
|
|
Write-Error "Must provide either -Query or -File parameter"
|
|
return
|
|
}
|
|
|
|
if ($OutputFile) {
|
|
$cmd += " > `"$OutputFile`""
|
|
}
|
|
|
|
Write-Host "Connecting to: $DB_NAME@$DB_HOST as $DB_USER" -ForegroundColor Cyan
|
|
Invoke-Expression $cmd
|
|
}
|
|
|
|
# Display current configuration
|
|
Write-Host "========================================" -ForegroundColor Cyan
|
|
Write-Host "Database Configuration Loaded" -ForegroundColor Cyan
|
|
Write-Host "========================================" -ForegroundColor Cyan
|
|
Write-Host "Database: $DB_NAME" -ForegroundColor Yellow
|
|
Write-Host "User: $DB_USER" -ForegroundColor Yellow
|
|
Write-Host "Host: $DB_HOST" -ForegroundColor Yellow
|
|
Write-Host "Port: $DB_PORT" -ForegroundColor Yellow
|
|
Write-Host "========================================" -ForegroundColor Cyan
|
|
Write-Host ""
|
|
Write-Host "To change database, edit: db-config.ps1" -ForegroundColor Gray
|
|
Write-Host "Then run: . .\db-config.ps1" -ForegroundColor Gray
|
|
Write-Host ""
|