meraproject/scripts/patch-msportalsection-mediumtext.ps1
keboss-m 5c21d25d45 Initial commit: Merakomis portal, Docker stack and user-reader API.
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-24 11:04:05 +03:00

21 lines
719 B
PowerShell

$root = Split-Path -Parent $PSScriptRoot
$dst = Join-Path $root 'data\mysql-init\01-j7508239_tracker.sql'
if (-not (Test-Path -LiteralPath $dst)) {
Write-Error "Not found: $dst. Run extract-tracker-db.ps1 first."
exit 1
}
$utf8 = New-Object System.Text.UTF8Encoding $false
$t = [System.IO.File]::ReadAllText($dst, $utf8)
$x = [regex]::Replace(
$t,
'`msPortalSection_data`\s+text(\s+COLLATE)',
'`msPortalSection_data` mediumtext$1',
[System.Text.RegularExpressions.RegexOptions]::IgnoreCase
)
if ($t -ceq $x) {
Write-Host "No change (already MEDIUMTEXT or CREATE not found)."
exit 0
}
[System.IO.File]::WriteAllText($dst, $x, $utf8)
Write-Host ('Patched msPortalSection_data in ' + $dst)