- database/schema/ 14개 DDL 파일 신규 생성 (운영 DB pg_dump 기반) - database/seed/ 14개 초기 데이터 파일 분리 - database/_deprecated/로 구 init.sql, auth_init.sql 이동 - database/README.md 신규 작성 (DB 아키텍처, 설치 절차) - docs/ 6개 가이드 문서 wing_auth→auth 스키마 구조로 수정 - README.md, CLAUDE.md wing 단일 DB 구조 반영 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
97 lines
5.6 KiB
SQL
97 lines
5.6 KiB
SQL
-- WING-OPS Seed Data: Auth Permission Tree
|
|
-- 트리 구조 기반 리소스(메뉴) 권한 정의 (48건)
|
|
-- 출처: database/migration/003_perm_tree.sql
|
|
|
|
-- ============================================================
|
|
-- Level 0: 메인 탭 (11건)
|
|
-- ============================================================
|
|
INSERT INTO auth.auth_perm_tree (rsrc_cd, parent_cd, rsrc_nm, rsrc_desc, rsrc_level, sort_ord) VALUES
|
|
('prediction', NULL, '유출유 확산예측', '확산 예측 실행 및 결과 조회', 0, 1),
|
|
('hns', NULL, 'HNS·대기확산', '대기확산 분석 실행 및 조회', 0, 2),
|
|
('rescue', NULL, '긴급구난', '구난 예측 실행 및 조회', 0, 3),
|
|
('reports', NULL, '보고자료', '사고 보고서 작성 및 조회', 0, 4),
|
|
('aerial', NULL, '항공탐색', '항공 탐색 데이터 조회', 0, 5),
|
|
('assets', NULL, '방제자산 관리', '방제 장비 및 자산 관리', 0, 6),
|
|
('scat', NULL, '해안평가', 'SCAT 조사 실행 및 조회', 0, 7),
|
|
('board', NULL, '게시판', '자료실 및 공지사항 조회', 0, 8),
|
|
('weather', NULL, '기상정보', '기상 및 해상 정보 조회', 0, 9),
|
|
('incidents', NULL, '통합조회', '사고 상세 정보 조회', 0, 10),
|
|
('admin', NULL, '관리', '사용자 및 권한 관리', 0, 11);
|
|
|
|
-- ============================================================
|
|
-- Level 1: prediction 하위 (4건)
|
|
-- ============================================================
|
|
INSERT INTO auth.auth_perm_tree (rsrc_cd, parent_cd, rsrc_nm, rsrc_level, sort_ord) VALUES
|
|
('prediction:analysis', 'prediction', '확산분석', 1, 1),
|
|
('prediction:list', 'prediction', '분석 목록', 1, 2),
|
|
('prediction:theory', 'prediction', '확산모델 이론', 1, 3),
|
|
('prediction:boom-theory', 'prediction', '오일펜스 배치 이론', 1, 4);
|
|
|
|
-- ============================================================
|
|
-- Level 1: hns 하위 (6건)
|
|
-- ============================================================
|
|
INSERT INTO auth.auth_perm_tree (rsrc_cd, parent_cd, rsrc_nm, rsrc_level, sort_ord) VALUES
|
|
('hns:analysis', 'hns', '대기확산 분석', 1, 1),
|
|
('hns:list', 'hns', '분석 목록', 1, 2),
|
|
('hns:scenario', 'hns', '시나리오 관리', 1, 3),
|
|
('hns:manual', 'hns', 'HNS 대응매뉴얼', 1, 4),
|
|
('hns:theory', 'hns', '확산모델 이론', 1, 5),
|
|
('hns:substance', 'hns', 'HNS 물질정보', 1, 6);
|
|
|
|
-- ============================================================
|
|
-- Level 1: rescue 하위 (4건)
|
|
-- ============================================================
|
|
INSERT INTO auth.auth_perm_tree (rsrc_cd, parent_cd, rsrc_nm, rsrc_level, sort_ord) VALUES
|
|
('rescue:rescue', 'rescue', '긴급구난예측', 1, 1),
|
|
('rescue:list', 'rescue', '긴급구난 목록', 1, 2),
|
|
('rescue:scenario', 'rescue', '시나리오 관리', 1, 3),
|
|
('rescue:theory', 'rescue', '긴급구난모델 이론', 1, 4);
|
|
|
|
-- ============================================================
|
|
-- Level 1: reports 하위 (3건)
|
|
-- ============================================================
|
|
INSERT INTO auth.auth_perm_tree (rsrc_cd, parent_cd, rsrc_nm, rsrc_level, sort_ord) VALUES
|
|
('reports:report-list', 'reports', '보고서 목록', 1, 1),
|
|
('reports:template', 'reports', '표준보고서 템플릿', 1, 2),
|
|
('reports:generate', 'reports', '보고서 생성', 1, 3);
|
|
|
|
-- ============================================================
|
|
-- Level 1: aerial 하위 (7건)
|
|
-- ============================================================
|
|
INSERT INTO auth.auth_perm_tree (rsrc_cd, parent_cd, rsrc_nm, rsrc_level, sort_ord) VALUES
|
|
('aerial:media', 'aerial', '영상사진관리', 1, 1),
|
|
('aerial:analysis', 'aerial', '유출유면적분석', 1, 2),
|
|
('aerial:realtime', 'aerial', '실시간드론', 1, 3),
|
|
('aerial:sensor', 'aerial', '오염/선박3D분석', 1, 4),
|
|
('aerial:satellite', 'aerial', '위성요청', 1, 5),
|
|
('aerial:cctv', 'aerial', 'CCTV 조회', 1, 6),
|
|
('aerial:theory', 'aerial', '항공탐색 이론', 1, 7);
|
|
|
|
-- ============================================================
|
|
-- Level 1: assets 하위 (4건)
|
|
-- ============================================================
|
|
INSERT INTO auth.auth_perm_tree (rsrc_cd, parent_cd, rsrc_nm, rsrc_level, sort_ord) VALUES
|
|
('assets:management', 'assets', '자산 관리', 1, 1),
|
|
('assets:upload', 'assets', '자산 현행화', 1, 2),
|
|
('assets:theory', 'assets', '방제자원 이론', 1, 3),
|
|
('assets:insurance', 'assets', '선박 보험정보', 1, 4);
|
|
|
|
-- ============================================================
|
|
-- Level 1: board 하위 (5건)
|
|
-- ============================================================
|
|
INSERT INTO auth.auth_perm_tree (rsrc_cd, parent_cd, rsrc_nm, rsrc_level, sort_ord) VALUES
|
|
('board:all', 'board', '전체', 1, 1),
|
|
('board:notice', 'board', '공지사항', 1, 2),
|
|
('board:data', 'board', '자료실', 1, 3),
|
|
('board:qna', 'board', 'Q&A', 1, 4),
|
|
('board:manual', 'board', '해경매뉴얼', 1, 5);
|
|
|
|
-- ============================================================
|
|
-- Level 1: admin 하위 (4건)
|
|
-- ============================================================
|
|
INSERT INTO auth.auth_perm_tree (rsrc_cd, parent_cd, rsrc_nm, rsrc_level, sort_ord) VALUES
|
|
('admin:users', 'admin', '사용자 관리', 1, 1),
|
|
('admin:permissions', 'admin', '권한 관리', 1, 2),
|
|
('admin:menus', 'admin', '메뉴 관리', 1, 3),
|
|
('admin:settings', 'admin', '시스템 설정', 1, 4);
|