Kansho/scripts/sqlite-to-postgres.ps1
Lars 07479f6a9f
Some checks failed
Deploy Development / deploy (push) Successful in 44s
Test Suite / backend-sqlite (push) Failing after 2s
Test Suite / frontend-build (push) Successful in 23s
Add Compose, Gitea deploy, and Postgres dual-backend on develop.
Use host ports 3006/8005 and 3096/8096 so Kansho does not collide with Bookstack on 3005 or the sister products.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-07 12:15:08 +02:00

30 lines
803 B
PowerShell

# Wrapper for backend/sqlite_to_postgres.py (personal data, require -Confirm).
[CmdletBinding()]
param(
[string]$Sqlite,
[string]$MediaSrc,
[string]$MediaDest,
[switch]$Confirm,
[switch]$Replace
)
$ErrorActionPreference = "Stop"
Set-StrictMode -Version Latest
$root = Split-Path -Parent $PSScriptRoot
$py = Join-Path $root "backend\.venv\Scripts\python.exe"
if (-not (Test-Path $py)) {
$py = "python"
}
$env:PYTHONUTF8 = "1"
$argsList = @((Join-Path $root "backend\sqlite_to_postgres.py"))
if ($Sqlite) { $argsList += @("--sqlite", $Sqlite) }
if ($MediaSrc) { $argsList += @("--media-src", $MediaSrc) }
if ($MediaDest) { $argsList += @("--media-dest", $MediaDest) }
if ($Confirm) { $argsList += "--confirm" }
if ($Replace) { $argsList += "--replace" }
& $py @argsList
exit $LASTEXITCODE