Add scripts for PostgreSQL migration and SQLite removal; update project references

- 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.
This commit is contained in:
2026-07-07 10:59:40 -04:00
parent bf51bff748
commit 9bcb8501ab
70 changed files with 1370 additions and 13 deletions
@@ -0,0 +1,78 @@
#!/bin/bash
# Database Configuration
# Edit this file to change which database commands run against
# Database connection settings
PSQL_PATH="/usr/bin/psql"
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
export PSQL_PATH
export DB_USER
export DB_NAME
export DB_HOST
export DB_PORT
# Helper function to run psql commands
invoke_psql() {
local query=""
local file=""
local output_file=""
while [[ $# -gt 0 ]]; do
case "$1" in
-q|--query)
query="$2"
shift 2
;;
-f|--file)
file="$2"
shift 2
;;
-o|--output-file)
output_file="$2"
shift 2
;;
*)
echo "Unknown option: $1"
return 1
;;
esac
done
local base_cmd="$PSQL_PATH -h $DB_HOST -p $DB_PORT -U $DB_USER -d $DB_NAME"
local cmd=""
if [ -n "$file" ]; then
cmd="$base_cmd -f \"$file\""
elif [ -n "$query" ]; then
cmd="$base_cmd -c \"$query\""
else
echo "Must provide either --query or --file parameter"
return 1
fi
if [ -n "$output_file" ]; then
cmd+=" > \"$output_file\""
fi
echo -e "\e[36mConnecting to: $DB_NAME@$DB_HOST as $DB_USER\e[0m"
eval "$cmd"
}
# Display current configuration
echo -e "\e[36m========================================\e[0m"
echo -e "\e[36mDatabase Configuration Loaded\e[0m"
echo -e "\e[36m========================================\e[0m"
echo -e "\e[33mDatabase: $DB_NAME\e[0m"
echo -e "\e[33mUser: $DB_USER\e[0m"
echo -e "\e[33mHost: $DB_HOST\e[0m"
echo -e "\e[33mPort: $DB_PORT\e[0m"
echo -e "\e[36m========================================\e[0m"
echo ""
echo -e "\e[90mTo change database, edit: db-config.sh\e[0m"
echo -e "\e[90mThen run: source db-config.sh\e[0m"
echo ""