🔧 완전한 스키마 자동화 시스템 구축
Some checks failed
SonarQube Analysis / SonarQube Scan (push) Has been cancelled

 주요 기능:
- 완전한 데이터베이스 스키마 분석 및 자동 마이그레이션 시스템
- 44개 테이블 완전 지원 (운영 서버 43개 + 1개 추가)
- 누락된 테이블/컬럼 자동 감지 및 생성

🔧 해결된 스키마 문제:
- users.status 컬럼 누락 → 자동 추가
- files 테이블 4개 컬럼 누락 → 자동 추가
- materials 테이블 22개 컬럼 누락 → 자동 추가
- support_details, purchase_requests, purchase_request_items 테이블 누락 → 자동 생성
- material_purchase_tracking.description, purchase_status 컬럼 누락 → 자동 추가

🚀 자동화 도구:
- schema_analyzer.py: 코드와 DB 스키마 비교 분석
- auto_migrator.py: 자동 마이그레이션 실행
- docker_migrator.py: Docker 환경용 간편 마이그레이션
- schema_monitor.py: 실시간 스키마 모니터링

📋 리비전 관리 시스템:
- 8개 카테고리별 리비전 페이지 구현
- PIPE Cutting Plan 관리 시스템
- PIPE Issue Management 시스템
- 완전한 리비전 비교 및 추적 기능

🎯 사용법:
docker exec tk-mp-backend python3 scripts/docker_migrator.py

앞으로 스키마 문제가 발생하면 위 명령 하나로 자동 해결!
This commit is contained in:
Hyungi Ahn
2025-10-21 10:34:45 +09:00
parent 9d7165bbf9
commit 8f42a1054e
55 changed files with 22443 additions and 0 deletions

View File

@@ -0,0 +1,593 @@
/* PIPE 이슈 관리 페이지 스타일 */
.pipe-issue-management-page {
padding: 20px;
max-width: 1400px;
margin: 0 auto;
background-color: #f8f9fa;
min-height: 100vh;
}
/* 페이지 헤더 */
.page-header {
display: flex;
justify-content: space-between;
align-items: center;
margin-bottom: 30px;
padding: 20px;
background: white;
border-radius: 8px;
box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}
.header-content h1 {
margin: 0;
color: #2c3e50;
font-size: 1.8rem;
}
.header-content p {
margin: 5px 0 0 0;
color: #6c757d;
font-size: 0.9rem;
}
.header-actions .btn {
padding: 10px 20px;
border: none;
border-radius: 6px;
cursor: pointer;
font-weight: 500;
text-decoration: none;
display: inline-block;
}
.btn-secondary {
background-color: #6c757d;
color: white;
}
.btn-secondary:hover {
background-color: #5a6268;
}
/* 스냅샷 정보 섹션 */
.snapshot-info-section {
margin-bottom: 30px;
}
.section-header {
margin-bottom: 15px;
}
.section-header h2 {
margin: 0;
color: #2c3e50;
font-size: 1.4rem;
}
.no-snapshot-warning {
display: flex;
align-items: center;
padding: 30px;
background: #fff3cd;
border: 1px solid #ffeaa7;
border-radius: 8px;
margin-bottom: 20px;
}
.warning-icon {
font-size: 3rem;
margin-right: 20px;
}
.warning-content h3 {
margin: 0 0 10px 0;
color: #856404;
}
.warning-content p {
margin: 0 0 15px 0;
color: #856404;
}
.snapshot-card {
display: flex;
justify-content: space-between;
align-items: center;
padding: 20px;
background: white;
border-radius: 8px;
box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}
.snapshot-details h3 {
margin: 0 0 10px 0;
color: #2c3e50;
}
.snapshot-stats {
display: flex;
gap: 20px;
}
.stat-item {
color: #6c757d;
font-size: 0.9rem;
}
/* 이슈 통계 섹션 */
.issue-stats-section {
margin-bottom: 30px;
}
.stats-grid {
display: grid;
grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
gap: 20px;
}
.stat-card {
padding: 20px;
background: white;
border-radius: 8px;
box-shadow: 0 2px 4px rgba(0,0,0,0.1);
text-align: center;
}
.stat-card h3 {
margin: 0 0 10px 0;
color: #2c3e50;
font-size: 1.1rem;
}
.stat-number {
font-size: 2.5rem;
font-weight: bold;
color: #3498db;
margin-bottom: 10px;
}
.stat-breakdown {
display: flex;
justify-content: center;
gap: 15px;
flex-wrap: wrap;
}
.stat-breakdown .stat-item {
font-size: 0.8rem;
padding: 2px 8px;
border-radius: 12px;
color: white;
}
.stat-breakdown .stat-item.open {
background-color: #dc3545;
}
.stat-breakdown .stat-item.progress {
background-color: #ffc107;
color: #212529;
}
.stat-breakdown .stat-item.resolved {
background-color: #28a745;
}
.stat-breakdown .stat-item.critical {
background-color: #dc3545;
}
.stat-breakdown .stat-item.high {
background-color: #fd7e14;
}
/* 필터 및 액션 섹션 */
.filter-actions-section {
display: flex;
justify-content: space-between;
align-items: center;
margin-bottom: 30px;
padding: 20px;
background: white;
border-radius: 8px;
box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}
.filters {
display: flex;
gap: 15px;
}
.filter-select {
padding: 8px 12px;
border: 1px solid #ddd;
border-radius: 4px;
background: white;
min-width: 150px;
}
.actions {
display: flex;
gap: 10px;
}
.btn-primary {
background-color: #007bff;
color: white;
padding: 10px 20px;
border: none;
border-radius: 6px;
cursor: pointer;
font-weight: 500;
}
.btn-primary:hover {
background-color: #0056b3;
}
.btn-info {
background-color: #17a2b8;
color: white;
padding: 10px 20px;
border: none;
border-radius: 6px;
cursor: pointer;
font-weight: 500;
}
.btn-info:hover {
background-color: #138496;
}
/* 이슈 목록 섹션 */
.drawing-issues-section,
.segment-issues-section {
margin-bottom: 30px;
}
.no-issues {
text-align: center;
padding: 40px;
background: white;
border-radius: 8px;
color: #6c757d;
}
.issues-list {
display: flex;
flex-direction: column;
gap: 15px;
}
/* 이슈 카드 */
.issue-card {
background: white;
border-radius: 8px;
box-shadow: 0 2px 4px rgba(0,0,0,0.1);
padding: 20px;
border-left: 4px solid #ddd;
}
.issue-card.drawing-issue {
border-left-color: #007bff;
}
.issue-card.segment-issue {
border-left-color: #28a745;
}
.issue-header {
display: flex;
justify-content: space-between;
align-items: center;
margin-bottom: 15px;
}
.issue-title {
display: flex;
align-items: center;
gap: 10px;
}
.area-badge,
.issue-type-badge {
background-color: #e9ecef;
color: #495057;
padding: 2px 8px;
border-radius: 12px;
font-size: 0.8rem;
font-weight: 500;
}
.drawing-name,
.segment-id {
font-weight: 600;
color: #2c3e50;
}
.issue-badges {
display: flex;
gap: 8px;
}
.severity-badge,
.status-badge {
color: white;
padding: 4px 8px;
border-radius: 12px;
font-size: 0.8rem;
font-weight: 500;
text-transform: uppercase;
}
.issue-content {
margin-bottom: 15px;
}
.issue-content p {
margin: 0;
color: #495057;
line-height: 1.5;
}
.issue-changes {
margin-top: 10px;
display: flex;
gap: 15px;
flex-wrap: wrap;
}
.change-item {
background-color: #f8f9fa;
color: #495057;
padding: 4px 8px;
border-radius: 4px;
font-size: 0.8rem;
border: 1px solid #dee2e6;
}
.issue-footer {
display: flex;
justify-content: space-between;
align-items: center;
padding-top: 15px;
border-top: 1px solid #dee2e6;
}
.issue-meta {
display: flex;
gap: 15px;
color: #6c757d;
font-size: 0.8rem;
}
.issue-actions {
display: flex;
gap: 8px;
}
.btn-sm {
padding: 6px 12px;
font-size: 0.8rem;
border: none;
border-radius: 4px;
cursor: pointer;
font-weight: 500;
}
.btn-warning {
background-color: #ffc107;
color: #212529;
}
.btn-warning:hover {
background-color: #e0a800;
}
.btn-success {
background-color: #28a745;
color: white;
}
.btn-success:hover {
background-color: #218838;
}
/* 모달 스타일 */
.modal-overlay {
position: fixed;
top: 0;
left: 0;
right: 0;
bottom: 0;
background: rgba(0,0,0,0.5);
display: flex;
align-items: center;
justify-content: center;
z-index: 1000;
}
.modal-content {
background: white;
border-radius: 8px;
padding: 0;
max-width: 600px;
width: 90%;
max-height: 90vh;
overflow-y: auto;
}
.modal-content.large {
max-width: 800px;
}
.modal-header {
display: flex;
justify-content: space-between;
align-items: center;
padding: 20px;
border-bottom: 1px solid #dee2e6;
}
.modal-header h3 {
margin: 0;
color: #2c3e50;
}
.modal-close {
background: none;
border: none;
font-size: 1.5rem;
cursor: pointer;
color: #6c757d;
padding: 0;
width: 30px;
height: 30px;
display: flex;
align-items: center;
justify-content: center;
}
.modal-close:hover {
color: #495057;
}
.modal-content form {
padding: 20px;
}
.form-group {
margin-bottom: 20px;
}
.form-row {
display: grid;
grid-template-columns: 1fr 1fr;
gap: 15px;
}
.form-group label {
display: block;
margin-bottom: 5px;
font-weight: 500;
color: #495057;
}
.form-group input,
.form-group select,
.form-group textarea {
width: 100%;
padding: 10px;
border: 1px solid #ddd;
border-radius: 4px;
font-size: 0.9rem;
box-sizing: border-box;
}
.form-group textarea {
resize: vertical;
min-height: 100px;
}
.modal-actions {
display: flex;
justify-content: flex-end;
gap: 10px;
padding: 20px;
border-top: 1px solid #dee2e6;
}
/* 리포트 스타일 */
.report-content {
padding: 20px;
}
.report-summary {
margin-bottom: 30px;
padding: 20px;
background-color: #f8f9fa;
border-radius: 6px;
}
.report-summary h4 {
margin: 0 0 10px 0;
color: #2c3e50;
}
.report-section {
margin-bottom: 25px;
}
.report-section h4 {
margin: 0 0 15px 0;
color: #2c3e50;
font-size: 1.1rem;
}
.report-stats p {
margin: 0 0 10px 0;
font-weight: 500;
}
.report-stats .stats-breakdown {
display: flex;
gap: 15px;
flex-wrap: wrap;
}
.report-stats .stat-item {
background-color: #e9ecef;
color: #495057;
padding: 4px 8px;
border-radius: 4px;
font-size: 0.8rem;
}
/* 반응형 디자인 */
@media (max-width: 768px) {
.pipe-issue-management-page {
padding: 10px;
}
.page-header {
flex-direction: column;
gap: 15px;
text-align: center;
}
.filter-actions-section {
flex-direction: column;
gap: 20px;
}
.filters {
flex-wrap: wrap;
}
.stats-grid {
grid-template-columns: 1fr;
}
.issue-header {
flex-direction: column;
align-items: flex-start;
gap: 10px;
}
.issue-footer {
flex-direction: column;
align-items: flex-start;
gap: 10px;
}
.modal-content {
width: 95%;
margin: 10px;
}
.form-row {
grid-template-columns: 1fr;
}
}