@extends('layouts.app') @section('title', '작업 단위 상세') @section('content')

작업 단위 상세

Operation ID: {{ $summary['operation_id'] }}

목록
@if(session('success'))
{{ session('success') }}
@endif @if(session('error'))
{{ session('error') }}
@endif

작업 요약

총 변경 건수
{{ $summary['total_count'] }}건
영향받은 테이블
@foreach($summary['tables'] as $table => $count) {{ $table }} ({{ $count }}) @endforeach
DML 유형
@foreach($summary['dml_types'] as $type => $count) {{ $type }} ({{ $count }}) @endforeach
시간 범위
{{ $summary['started_at']->format('Y-m-d H:i:s') }} @if($summary['started_at'] != $summary['ended_at'])
~ {{ $summary['ended_at']->format('H:i:s') }} @endif
@if($summary['actor_id'])
Actor ID
{{ $summary['actor_id'] }}
@endif @if($summary['session_info'])
IP / Route
{{ $summary['session_info']['ip'] ?? '-' }} / {{ $summary['session_info']['route'] ?? '-' }}
@endif

변경 내역 (롤백 실행 순서)

@foreach($rollbackItems as $idx => $item) @php $log = $item['log']; @endphp
{{ $loop->iteration }} {{ $log->dml_type }} {{ $log->table_name }}.{{ $log->row_id }} #{{ $log->id }}
@if($log->dml_type === 'INSERT') DELETE @elseif($log->dml_type === 'UPDATE') REVERT @elseif($log->dml_type === 'DELETE') RE-INSERT @endif 상세
{{ $item['sql'] }}
@if($log->changed_columns)
@foreach($log->changed_columns as $col) {{ $col }} @endforeach
@endif
@endforeach

일괄 롤백 주의사항

  • 위 {{ $summary['total_count'] }}건의 SQL이 하나의 트랜잭션으로 실행됩니다.
  • 롤백은 역순(마지막 변경 → 첫 번째 변경)으로 실행됩니다.
  • 롤백 이후 해당 레코드에 추가 변경이 있었으면 데이터 충돌이 발생할 수 있습니다.
  • 실패 시 전체 트랜잭션이 롤백되어 데이터는 변경되지 않습니다.
  • 운영 환경에서는 반드시 백업 후 실행하세요.
@csrf
@endsection