signal-batch/scripts/fix-postgis-schema.ps1
htlee 2e9361ee58 refactor: SNP API 전환 및 레거시 코드 전면 정리
- CollectDB 다중 신호 수집 → S&P Global AIS API 단일 수집으로 전환
- sig_src_cd + target_id 이중 식별자 → mmsi(VARCHAR) 단일 식별자
- t_vessel_latest_position → t_ais_position 테이블 전환
- 레거시 배치/유틸 ~30개 클래스 삭제 (VesselAggregationJobConfig, ShipKindCodeConverter 등)
- AisTargetCacheManager 기반 캐시 이중 구조 (최신위치 + 트랙 버퍼)
- CacheBasedVesselTrackDataReader + CacheBasedTrackJobListener 신규 추가
- VesselStaticStepConfig: 정적정보 CDC 변경 검출 + hourly job 편승
- SignalKindCode enum: vesselType/extraInfo 기반 선종 자동 분류
- WebSocket/STOMP 전체 mmsi 전환 (StompTrackStreamingService ~40곳)
- 모니터링/성능 최적화 코드 mmsi 기반 전환
- DataSource 설정 통합 (snpdb 단일 DB)
- AreaBoundaryCache Polygon→Geometry 캐스트 수정 (MULTIPOLYGON 지원)
- ConcurrentHashMap 적용 (VesselTrackStepConfig 동시성 버그 수정)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-19 09:59:49 +09:00

25 lines
895 B
PowerShell

# PostGIS 함수 스키마 명시 스크립트
# ST_GeomFromText -> public.ST_GeomFromText로 변경
$javaDir = "C:\Users\lht87\IdeaProjects\signal_batch\src\main\java"
$files = Get-ChildItem -Path $javaDir -Filter "*.java" -Recurse
$count = 0
foreach ($file in $files) {
$content = Get-Content $file.FullName -Raw -Encoding UTF8
# ST_GeomFromText를 public.ST_GeomFromText로 변경 (이미 public.가 붙어있지 않은 경우만)
$newContent = $content -replace '(?<!public\.)ST_GeomFromText\(', 'public.ST_GeomFromText('
# ST_Length도 변경
$newContent = $newContent -replace '(?<!public\.)ST_Length\(', 'public.ST_Length('
if ($content -ne $newContent) {
Set-Content -Path $file.FullName -Value $newContent -Encoding UTF8 -NoNewline
Write-Host "Updated: $($file.FullName)"
$count++
}
}
Write-Host "`nTotal files updated: $count"