Files
aio-01d4-stu/Lecture/FinalProject/Doc/Step2/DB스키마설계서_작성법.html
T

148 lines
116 KiB
HTML
Raw Normal View History

<!DOCTYPE html>
<html lang="ko"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1">
<title>DB 스키마 설계서 작성법</title>
<style>
*{box-sizing:border-box;margin:0;padding:0}
html,body{background:#060d18;color:#F1F5F9;font-family:"Noto Sans KR","Noto Sans CJK KR","Apple SD Gothic Neo","Malgun Gothic",sans-serif}
.stage{width:1280px;transform-origin:0 0;margin:0 auto}
.slide{position:relative;width:1280px;height:720px;background:#0F1B2D;overflow:hidden;margin:0 0 24px}
.r,.t{position:absolute}
.t{display:flex;flex-direction:column;line-height:1.38;white-space:pre-wrap;word-break:keep-all;overflow-wrap:anywhere;font-weight:400}
.t.m{font-family:"D2Coding","Consolas","Menlo","DejaVu Sans Mono","Noto Sans KR","Noto Sans CJK KR",monospace;line-height:1.36;word-break:normal}
.t.ul .li{padding-left:1.2em;text-indent:-1.2em;margin-bottom:var(--gap,12px)}
.t.ul .li::before{content:"•";display:inline-block;width:1.2em;text-indent:0;color:#2DD4BF}
.bar{position:fixed;right:14px;bottom:10px;font-size:12px;color:#A8B8CC;background:rgba(6,13,24,.8);padding:4px 10px;border-radius:12px;z-index:9}
body.present{overflow:hidden}
body.present .slide{display:none;margin:0}
body.present .slide.on{display:block}
@page{size:1280px 720px;margin:0}
@media print{html,body{background:#0F1B2D}.bar{display:none}.stage{transform:none!important;margin:0!important}
.slide,body.present .slide{display:block;margin:0;break-after:page;break-inside:avoid}
*{-webkit-print-color-adjust:exact;print-color-adjust:exact}}
</style></head><body>
<main class="stage">
<section class="slide"><h1 class="t" style="left:57.599999999999994px;top:211.20000000000002px;width:1056px;height:115.19999999999999px;font-size:64px;color:#F1F5F9;font-weight:700;text-align:left;justify-content:center;"><span>DB 스키마 설계서 작성법</span></h1><div class="t" style="left:57.599999999999994px;top:336px;width:1056px;height:48px;font-size:29.333333333333332px;color:#2DD4BF;text-align:left;justify-content:center;"><span>최종 프로젝트 STEP 2 · PostgreSQL(Supabase) · pgvector · Redis</span></div><div class="t" style="left:57.599999999999994px;top:398.40000000000003px;width:1056px;height:38.400000000000006px;font-size:20px;color:#A8B8CC;text-align:left;justify-content:center;"><span>AI 애플리케이션 개발 과정 · 최종 프로젝트 산출물 가이드</span></div><div class="r" style="left:57.599999999999994px;top:537.5999999999999px;width:263.23199999999997px;height:48px;background:#1A2B45;border-radius:24px"></div><div class="t m" style="left:57.599999999999994px;top:537.5999999999999px;width:263.23199999999997px;height:48px;font-size:18.666666666666668px;color:#2DD4BF;text-align:center;justify-content:center;"><span>users 1:N incidents</span></div><div class="r" style="left:344.832px;top:537.5999999999999px;width:172.608px;height:48px;background:#1A2B45;border-radius:24px"></div><div class="t m" style="left:344.832px;top:537.5999999999999px;width:172.608px;height:48px;font-size:18.666666666666668px;color:#2DD4BF;text-align:center;justify-content:center;"><span>PRIMARY KEY</span></div><div class="r" style="left:541.44px;top:537.5999999999999px;width:183.93599999999998px;height:48px;background:#1A2B45;border-radius:24px"></div><div class="t m" style="left:541.44px;top:537.5999999999999px;width:183.93599999999998px;height:48px;font-size:18.666666666666668px;color:#2DD4BF;text-align:center;justify-content:center;"><span>VECTOR(1536)</span></div><div class="r" style="left:749.3760000000001px;top:537.5999999999999px;width:251.90399999999997px;height:48px;background:#1A2B45;border-radius:24px"></div><div class="t m" style="left:749.3760000000001px;top:537.5999999999999px;width:251.90399999999997px;height:48px;font-size:18.666666666666668px;color:#2DD4BF;text-align:center;justify-content:center;"><span>ROW LEVEL SECURITY</span></div></section>
<section class="slide"><h2 class="t" style="left:57.599999999999994px;top:43.2px;width:1164.768px;height:86.4px;font-size:42.666666666666664px;color:#F1F5F9;font-weight:700;text-align:left;justify-content:center;"><span>DB 스키마 설계서는 데이터의 설계도다</span></h2><div class="t" style="left:57.599999999999994px;top:672px;width:576px;height:28.799999999999997px;font-size:13.333333333333334px;color:#A8B8CC;text-align:left;justify-content:center;"><span>최종 프로젝트 · DB 스키마 설계서 작성법</span></div><div class="t" style="left:1145.568px;top:672px;width:76.80000000000001px;height:28.799999999999997px;font-size:13.333333333333334px;color:#A8B8CC;text-align:right;justify-content:center;"><span>2</span></div><div class="t" style="left:57.599999999999994px;top:134.39999999999998px;width:1164.768px;height:43.2px;font-size:22.666666666666668px;color:#2DD4BF;text-align:left;justify-content:center;"><span>API 설계 문서가 '주고받는 것'의 약속이라면, 이 문서는 '저장하는 것'의 약속이다</span></div><div class="r" style="left:57.599999999999994px;top:206.39999999999998px;width:369.05600000000004px;height:316.79999999999995px;background:#1A2B45;border-radius:9.600000000000001px"></div><div class="t" style="left:86.39999999999999px;top:235.2px;width:311.456px;height:28.799999999999997px;font-size:18.666666666666668px;color:#2DD4BF;font-weight:700;text-align:left;justify-content:center;"><span>무엇을</span></div><div class="t" style="left:86.39999999999999px;top:273.59999999999997px;width:311.456px;height:40.32px;font-size:26.666666666666668px;color:#F1F5F9;font-weight:700;text-align:left;justify-content:center;"><span>저장할 데이터를 정한다</span></div><div class="t" style="left:86.39999999999999px;top:326.4px;width:311.456px;height:168px;font-size:20px;color:#CBD5E1;text-align:left;justify-content:flex-start;"><span>테이블과 컬럼, 타입, 제약을 정한다. API가 주고받는 필드가 어디에 저장되는지 보인다.</span></div><div class="r" style="left:455.456px;top:206.39999999999998px;width:369.05600000000004px;height:316.79999999999995px;background:#1A2B45;border-radius:9.600000000000001px"></div><div class="t" style="left:484.256px;top:235.2px;width:311.456px;height:28.799999999999997px;font-size:18.666666666666668px;color:#2DD4BF;font-weight:700;text-align:left;justify-content:center;"><span>어떻게</span></div><div class="t" style="left:484.256px;top:273.59999999999997px;width:311.456px;height:40.32px;font-size:26.666666666666668px;color:#F1F5F9;font-weight:700;text-align:left;justify-content:center;"><span>테이블을 잇는다</span></div><div class="t" style="left:484.256px;top:326.4px;width:311.456px;height:168px;font-size:20px;color:#CBD5E1;text-align:left;justify-content:flex-start;"><span>기본키와 외래키로 관계를 정한다. 잘못된 데이터가 들어오지 못하게 DB가 막아 준다.</span></div><div class="r" style="left:853.3120000000001px;top:206.39999999999998px;width:369.05600000000004px;height:316.79999999999995px;background:#1A2B45;border-radius:9.600000000000001px"></div><div class="t" style="left:882.1120000000001px;top:235.2px;width:311.456px;height:28.799999999999997px;font-size:18.666666666666668px;color:#2DD4BF;font-weight:700;text-align:left;justify-content:center;"><span>누가</span></div><div class="t" style="left:882.1120000000001px;top:273.59999999999997px;width:311.456px;height:40.32px;font-size:26.666666666666668px;color:#F1F5F9;font-weight:700;text-align:left;justify-content:center;"><span>볼 수 있는 사람을 정한다</span></div><div class="t" style="left:882.1120000000001px;top:326.4px;width:311.456px;height:168px;font-size:20px;color:#CBD5E1;text-align:left;justify-content:flex-start;"><span>RLS 정책으로 역할별 조회·수정 권한을 정한다. 보안 가드레일 문서의 근거가 된다.</span></div></section>
<section class="slide"><h2 class="t" style="left:57.599999999999994px;top:43.2px;width:1164.768px;height:86.4px;font-size:42.666666666666664px;color:#F1F5F9;font-weight:700;text-align:left;justify-content:center;"><span>API 설계 문서에서 이어지는 자리</span></h2><div class="t" style="left:57.599999999999994px;top:672px;width:576px;height:28.799999999999997px;font-size:13.333333333333334px;color:#A8B8CC;text-align:left;justify-content:center;"><span>최종 프로젝트 · DB 스키마 설계서 작성법</span></div><div class="t" style="left:1145.568px;top:672px;width:76.80000000000001px;height:28.799999999999997px;font-size:13.333333333333334px;color:#A8B8CC;text-align:right;justify-content:center;"><span>3</span></div><div class="t" style="left:57.599999999999994px;top:134.39999999999998px;width:1164.768px;height:43.2px;font-size:22.666666666666668px;color:#2DD4BF;text-align:left;justify-content:center;"><span>두 문서는 STEP 2의 짝 산출물이다. 나란히 놓고 함께 쓴다</span></div><div class="r" style="left:57.599999999999994px;top:240px;width:200.69760000000002px;height:220.79999999999998px;background:#1A2B45;border-radius:9.600000000000001px"></div><div class="t" style="left:72px;top:268.79999999999995px;width:171.8976px;height:48px;font-size:24px;color:#F1F5F9;font-weight:700;text-align:center;justify-content:center;"><span>기획서</span></div><div class="t" style="left:72px;top:331.20000000000005px;width:171.8976px;height:86.4px;font-size:18.666666666666668px;color:#CBD5E1;text-align:center;justify-content:flex-start;"><span>기능 요구사항
FR-01 …</span></div><div class="t" style="left:258.29760000000005px;top:240px;width:40.32px;height:220.79999999999998px;font-size:26.666666666666668px;color:#2DD4BF;text-align:center;justify-content:center;"><span>→</span></div><div class="r" style="left:298.61760000000004px;top:240px;width:200.69760000000002px;height:220.79999999999998px;background:#1A2B45;border-radius:9.600000000000001px"></div><div class="t" style="left:313.0176px;top:268.79999999999995px;width:171.8976px;height:48px;font-size:24px;color:#F1F5F9;font-weight:700;text-align:center;justify-content:center;"><span>API 설계 문서</span></div><div class="t" style="left:313.0176px;top:331.20000000000005px;width:171.8976px;height:86.4px;font-size:18.666666666666668px;color:#CBD5E1;text-align:center;justify-content:flex-start;"><span>지난 시간에
다룬 산출물</span></div><div class="t" style="left:499.3152px;top:240px;width:40.32px;height:220.79999999999998px;font-size:26.666666666666668px;color:#2DD4BF;text-align:center;justify-content:center;"><span>→</span></div><div class="r" style="left:539.6351999999999px;top:240px;width:200.69760000000002px;height:220.79999999999998px;background:#0F766E;border-radius:9.600000000000001px"></div><div class="t" style="left:554.0352px;top:268.79999999999995px;width:171.8976px;height:48px;font-size:24px;color:#F1F5F9;font-weight:700;text-align:center;justify-content:center;"><span>DB 스키마 설계서</span></div><div class="t" style="left:554.0352px;top:331.20000000000005px;width:171.8976px;height:86.4px;font-size:18.666666666666668px;color:#F1F5F9;text-align:center;justify-content:flex-start;"><span>오늘 다루는
산출물</span></div><div class="t" style="left:740.3328px;top:240px;width:40.32px;height:220.79999999999998px;font-size:26.666666666666668px;color:#2DD4BF;text-align:center;justify-content:center;"><span>→</span></div><div class="r" style="left:780.6528000000001px;top:240px;width:200.69760000000002px;height:220.79999999999998px;background:#1A2B45;border-radius:9.600000000000001px"></div><div class="t" style="left:795.0528px;top:268.79999999999995px;width:171.8976px;height:48px;font-size:24px;color:#F1F5F9;font-weight:700;text-align:center;justify-content:center;"><span>에이전트 설계</span></div><div class="t" style="left:795.0528px;top:331.20000000000005px;width:171.8976px;height:86.4px;font-size:18.666666666666668px;color:#CBD5E1;text-align:center;justify-content:flex-start;"><span>메모리와
체크포인트 저장</span></div><div class="t" style="left:981.3504px;top:240px;width:40.32px;height:220.79999999999998px;font-size:26.666666666666668px;color:#2DD4BF;text-align:center;justify-content:center;"><span>→</span></div><div class="r" style="left:1021.6704px;top:240px;width:200.69760000000002px;height:220.79999999999998px;background:#1A2B45;border-radius:9.600000000000001px"></div><div class="t" style="left:1036.0704px;top:268.79999999999995px;width:171.8976px;height:48px;font-size:24px;color:#F1F5F9;font-weight:700;text-align:center;justify-content:center;"><span>통합 테스트</span></div><div class="t" style="left:1036.0704px;top:331.20000000000005px;width:171.8976px;height:86.4px;font-size:18.666666666666668px;color:#CBD5E1;text-align:center;justify-content:flex-start;"><span>권한과 데이터
정합성 확인</span></div><div class="r" style="left:57.599999999999994px;top:513.5999999999999px;width:1164.768px;height:71.03999999999999px;background:#0A1322;border-radius:7.68px"></div><div class="t" style="left:86.39999999999999px;top:513.5999999999999px;width:1107.1680000000001px;height:71.03999999999999px;font-size:18.666666666666668px;color:#CBD5E1;text-align:left;justify-content:center;"><span>API 요청과 응답의 필드가 테이블의 컬럼이 된다. 필드명과 컬럼명, ID 형식을 두 문서에서 똑같이 쓴다.</span></div></section>
<section class="slide"><h2 class="t" style="left:57.599999999999994px;top:43.2px;width:1164.768px;height:86.4px;font-size:42.666666666666664px;color:#F1F5F9;font-weight:700;text-align:left;justify-content:center;"><span>문서에 들어가는 여섯 가지</span></h2><div class="t" style="left:57.599999999999994px;top:672px;width:576px;height:28.799999999999997px;font-size:13.333333333333334px;color:#A8B8CC;text-align:left;justify-content:center;"><span>최종 프로젝트 · DB 스키마 설계서 작성법</span></div><div class="t" style="left:1145.568px;top:672px;width:76.80000000000001px;height:28.799999999999997px;font-size:13.333333333333334px;color:#A8B8CC;text-align:right;justify-content:center;"><span>4</span></div><div class="r" style="left:57.599999999999994px;top:168px;width:369.05600000000004px;height:225.60000000000002px;background:#1A2B45;border-radius:9.600000000000001px"></div><div class="t" style="left:86.39999999999999px;top:196.79999999999998px;width:311.456px;height:28.799999999999997px;font-size:18.666666666666668px;color:#2DD4BF;font-weight:700;text-align:left;justify-content:center;"><span>01</span></div><div class="t" style="left:86.39999999999999px;top:235.2px;width:311.456px;height:40.32px;font-size:26.666666666666668px;color:#F1F5F9;font-weight:700;text-align:left;justify-content:center;"><span>ERD와 관계 명세</span></div><div class="t" style="left:86.39999999999999px;top:288px;width:311.456px;height:76.79999999999998px;font-size:20px;color:#CBD5E1;text-align:left;justify-content:flex-start;"><span>테이블 사이의 관계를 그림과 표로</span></div><div class="r" style="left:455.456px;top:168px;width:369.05600000000004px;height:225.60000000000002px;background:#1A2B45;border-radius:9.600000000000001px"></div><div class="t" style="left:484.256px;top:196.79999999999998px;width:311.456px;height:28.799999999999997px;font-size:18.666666666666668px;color:#2DD4BF;font-weight:700;text-align:left;justify-content:center;"><span>02</span></div><div class="t" style="left:484.256px;top:235.2px;width:311.456px;height:40.32px;font-size:26.666666666666668px;color:#F1F5F9;font-weight:700;text-align:left;justify-content:center;"><span>엔터티 정의</span></div><div class="t" style="left:484.256px;top:288px;width:311.456px;height:76.79999999999998px;font-size:20px;color:#CBD5E1;text-align:left;justify-content:flex-start;"><span>컬럼마다 타입·제약·의미</span></div><div class="r" style="left:853.3120000000001px;top:168px;width:369.05600000000004px;height:225.60000000000002px;background:#1A2B45;border-radius:9.600000000000001px"></div><div class="t" style="left:882.1120000000001px;top:196.79999999999998px;width:311.456px;height:28.799999999999997px;font-size:18.666666666666668px;color:#2DD4BF;font-weight:700;text-align:left;justify-content:center;"><span>03</span></div><div class="t" style="left:882.1120000000001px;top:235.2px;width:311.456px;height:40.32px;font-size:26.666666666666668px;color:#F1F5F9;font-weight:700;text-align:left;justify-content:center;"><span>pgvector 스키마</span></div><div class="t" style="left:882.1120000000001px;top:288px;width:311.456px;height:76.79999999999998px;font-size:20px;color:#CBD5E1;text-align:left;justify-content:flex-start;"><span>문서·청크 테이블과 벡터 인덱스</span></div><div class="r" style="left:57.599999999999994px;top:422.40000000000003px;width:369.05600000000004px;height:225.60000000000002px;background:#1A2B45;border-radius:9.600000000000001px"></div><div class="t" style="left:86.39999999999999px;top:451.20000000000005px;width:311.456px;height:28.799999999999997px;font-size:18.666666666666668px;color:#2DD4BF;font-weight:700;text-align:left;justify-content:center;"><span>04</span></div><div class="t" style="left:86.39999999999999px;top:489.6px;width:311.456px;height:40.32px;font-size:26.666666666666668px;color:#F1F5F9;font-weight:700;text-align:left;justify-content:center;"><span>RLS 정책</span></div><div class="t" style="left:86.39999999999999px;top:542.4000000000001px;width:311.456px;height:76.79999999999998px;font-size:20p
<section class="slide"><h2 class="t" style="left:57.599999999999994px;top:43.2px;width:1164.768px;height:86.4px;font-size:42.666666666666664px;color:#F1F5F9;font-weight:700;text-align:left;justify-content:center;"><span>테이블은 행과 열로 된 표다</span></h2><div class="t" style="left:57.599999999999994px;top:672px;width:576px;height:28.799999999999997px;font-size:13.333333333333334px;color:#A8B8CC;text-align:left;justify-content:center;"><span>최종 프로젝트 · DB 스키마 설계서 작성법</span></div><div class="t" style="left:1145.568px;top:672px;width:76.80000000000001px;height:28.799999999999997px;font-size:13.333333333333334px;color:#A8B8CC;text-align:right;justify-content:center;"><span>5</span></div><div class="t" style="left:57.599999999999994px;top:134.39999999999998px;width:1164.768px;height:43.2px;font-size:22.666666666666668px;color:#2DD4BF;text-align:left;justify-content:center;"><span>엑셀 시트와 비슷하지만, 열마다 타입과 규칙이 정해져 있다는 점이 다르다</span></div><div class="r" style="left:57.599999999999994px;top:206.39999999999998px;width:369.05600000000004px;height:412.79999999999995px;background:#1A2B45;border-radius:9.600000000000001px"></div><div class="t" style="left:86.39999999999999px;top:235.2px;width:311.456px;height:28.799999999999997px;font-size:18.666666666666668px;color:#2DD4BF;font-weight:700;text-align:left;justify-content:center;"><span>테이블 (엔터티)</span></div><div class="t" style="left:86.39999999999999px;top:273.59999999999997px;width:311.456px;height:40.32px;font-size:26.666666666666668px;color:#F1F5F9;font-weight:700;text-align:left;justify-content:center;"><span>대상 하나에 표 하나</span></div><div class="t" style="left:86.39999999999999px;top:326.4px;width:311.456px;height:96px;font-size:20px;color:#CBD5E1;text-align:left;justify-content:flex-start;"><span>사용자, 장애, 복구 작업처럼 서비스가 다루는 대상의 종류마다 테이블을 하나씩 만든다.</span></div><div class="r" style="left:86.39999999999999px;top:483.8399999999999px;width:311.456px;height:106.56px;background:#0A1322;border-radius:5.76px"></div><div class="t m" style="left:103.67999999999998px;top:483.8399999999999px;width:276.896px;height:106.56px;font-size:16px;color:#2DD4BF;text-align:left;justify-content:center;"><span>users
incidents
recovery_jobs</span></div><div class="r" style="left:455.456px;top:206.39999999999998px;width:369.05600000000004px;height:412.79999999999995px;background:#1A2B45;border-radius:9.600000000000001px"></div><div class="t" style="left:484.256px;top:235.2px;width:311.456px;height:28.799999999999997px;font-size:18.666666666666668px;color:#2DD4BF;font-weight:700;text-align:left;justify-content:center;"><span>컬럼 (열)</span></div><div class="t" style="left:484.256px;top:273.59999999999997px;width:311.456px;height:40.32px;font-size:26.666666666666668px;color:#F1F5F9;font-weight:700;text-align:left;justify-content:center;"><span>속성과 타입, 제약</span></div><div class="t" style="left:484.256px;top:326.4px;width:311.456px;height:96px;font-size:20px;color:#CBD5E1;text-align:left;justify-content:flex-start;"><span>대상이 갖는 속성이다. 어떤 타입의 값이 들어가는지, 비워도 되는지를 함께 정한다.</span></div><div class="r" style="left:484.256px;top:535.68px;width:311.456px;height:54.720000000000006px;background:#0A1322;border-radius:5.76px"></div><div class="t m" style="left:501.53599999999994px;top:535.68px;width:276.896px;height:54.720000000000006px;font-size:16px;color:#2DD4BF;text-align:left;justify-content:center;"><span>status TEXT NOT NULL</span></div><div class="r" style="left:853.3120000000001px;top:206.39999999999998px;width:369.05600000000004px;height:412.79999999999995px;background:#1A2B45;border-radius:9.600000000000001px"></div><div class="t" style="left:882.1120000000001px;top:235.2px;width:311.456px;height:28.799999999999997px;font-size:18.666666666666668px;color:#2DD4BF;font-weight:700;text-align:left;justify-content:center;"><span>행 (레코드)</span></div><div class="t" style="left:882.1120000000001px;top:273.59999999999997px;width:311.456px;height:40.32px;font-size:26.666666666666668px;color:#F1F5F9;font-weight:700;text-align:left;justify-content:center;"><span>실제 데이터 한 건</span></div><div class="t" style="left:882.1120000000001px;top:326.4px;width:311.456px;height:96px;font-size:20px;color:#CBD5E1;text-align:left;justify-content:flex-start;"><span>장애 한 건, 사용자 한 명이 행 하나다. API 응답의 JSON 객체 하나에 해당한다.</span></div><div class="r" style="left:882.1120000000001px;top:535.68px;width:311.456px;height:54.720000000000006px;background:#0A1322;border-radius:5.76px"></div><div class="t m" style="left:899.392px;top:535.68px;width:276.896px;height:54.720000000000006px;font-size:16px;color:#2DD4BF;text-align:left;justify-content:center;"><span>inc-001 | detected</span></div></section>
<section class="slide"><h2 class="t" style="left:57.599999999999994px;top:43.2px;width:1164.768px;height:86.4px;font-size:42.666666666666664px;color:#F1F5F9;font-weight:700;text-align:left;justify-content:center;"><span>키와 제약이 데이터를 지킨다</span></h2><div class="t" style="left:57.599999999999994px;top:672px;width:576px;height:28.799999999999997px;font-size:13.333333333333334px;color:#A8B8CC;text-align:left;justify-content:center;"><span>최종 프로젝트 · DB 스키마 설계서 작성법</span></div><div class="t" style="left:1145.568px;top:672px;width:76.80000000000001px;height:28.799999999999997px;font-size:13.333333333333334px;color:#A8B8CC;text-align:right;justify-content:center;"><span>6</span></div><div class="r" style="left:57.599999999999994px;top:168px;width:1164.768px;height:48px;background:#22375A;border-radius:0px"></div><div class="t" style="left:78.72px;top:168px;width:190.71360000000004px;height:48px;font-size:18.666666666666668px;color:#2DD4BF;font-weight:700;text-align:left;justify-content:center;"><span>용어</span></div><div class="t" style="left:311.6736000000001px;top:168px;width:400.37184px;height:48px;font-size:18.666666666666668px;color:#2DD4BF;font-weight:700;text-align:left;justify-content:center;"><span>뜻</span></div><div class="t" style="left:754.28544px;top:168px;width:446.96255999999994px;height:48px;font-size:18.666666666666668px;color:#2DD4BF;font-weight:700;text-align:left;justify-content:center;"><span>예시</span></div><div class="r" style="left:57.599999999999994px;top:216px;width:1164.768px;height:67.19999999999999px;background:#1A2B45;border-radius:0px"></div><div class="t" style="left:78.72px;top:216px;width:190.71360000000004px;height:67.19999999999999px;font-size:18.666666666666668px;color:#F1F5F9;font-weight:700;text-align:left;justify-content:center;"><span>기본키 (PK)</span></div><div class="t" style="left:311.6736000000001px;top:216px;width:400.37184px;height:67.19999999999999px;font-size:18.666666666666668px;color:#CBD5E1;text-align:left;justify-content:center;"><span>행 하나를 유일하게 가리키는 컬럼</span></div><div class="t m" style="left:754.28544px;top:216px;width:446.96255999999994px;height:67.19999999999999px;font-size:18.666666666666668px;color:#2DD4BF;text-align:left;justify-content:center;"><span>incidents.id</span></div><div class="r" style="left:57.599999999999994px;top:283.20000000000005px;width:1164.768px;height:67.19999999999999px;background:#15233A;border-radius:0px"></div><div class="t" style="left:78.72px;top:283.20000000000005px;width:190.71360000000004px;height:67.19999999999999px;font-size:18.666666666666668px;color:#F1F5F9;font-weight:700;text-align:left;justify-content:center;"><span>외래키 (FK)</span></div><div class="t" style="left:311.6736000000001px;top:283.20000000000005px;width:400.37184px;height:67.19999999999999px;font-size:18.666666666666668px;color:#CBD5E1;text-align:left;justify-content:center;"><span>다른 테이블의 기본키를 가리키는 컬럼</span></div><div class="t m" style="left:754.28544px;top:283.20000000000005px;width:446.96255999999994px;height:67.19999999999999px;font-size:18.666666666666668px;color:#2DD4BF;text-align:left;justify-content:center;"><span>recovery_jobs.incident_id → incidents.id</span></div><div class="r" style="left:57.599999999999994px;top:350.40000000000003px;width:1164.768px;height:67.19999999999999px;background:#1A2B45;border-radius:0px"></div><div class="t" style="left:78.72px;top:350.40000000000003px;width:190.71360000000004px;height:67.19999999999999px;font-size:18.666666666666668px;color:#F1F5F9;font-weight:700;text-align:left;justify-content:center;"><span>UNIQUE</span></div><div class="t" style="left:311.6736000000001px;top:350.40000000000003px;width:400.37184px;height:67.19999999999999px;font-size:18.666666666666668px;color:#CBD5E1;text-align:left;justify-content:center;"><span>같은 값이 두 번 들어갈 수 없다</span></div><div class="t m" style="left:754.28544px;top:350.40000000000003px;width:446.96255999999994px;height:67.19999999999999
<section class="slide"><h2 class="t" style="left:57.599999999999994px;top:43.2px;width:1164.768px;height:86.4px;font-size:42.666666666666664px;color:#F1F5F9;font-weight:700;text-align:left;justify-content:center;"><span>테이블 사이의 관계는 세 종류다</span></h2><div class="t" style="left:57.599999999999994px;top:672px;width:576px;height:28.799999999999997px;font-size:13.333333333333334px;color:#A8B8CC;text-align:left;justify-content:center;"><span>최종 프로젝트 · DB 스키마 설계서 작성법</span></div><div class="t" style="left:1145.568px;top:672px;width:76.80000000000001px;height:28.799999999999997px;font-size:13.333333333333334px;color:#A8B8CC;text-align:right;justify-content:center;"><span>7</span></div><div class="t" style="left:57.599999999999994px;top:134.39999999999998px;width:1164.768px;height:43.2px;font-size:22.666666666666668px;color:#2DD4BF;text-align:left;justify-content:center;"><span>ERD를 그리기 전에, 두 테이블이 몇 대 몇으로 짝지어지는지 먼저 말로 적어 본다</span></div><div class="r" style="left:57.599999999999994px;top:206.39999999999998px;width:369.05600000000004px;height:412.79999999999995px;background:#1A2B45;border-radius:9.600000000000001px"></div><div class="t" style="left:86.39999999999999px;top:235.2px;width:311.456px;height:28.799999999999997px;font-size:18.666666666666668px;color:#2DD4BF;font-weight:700;text-align:left;justify-content:center;"><span>1 : N</span></div><div class="t" style="left:86.39999999999999px;top:273.59999999999997px;width:311.456px;height:40.32px;font-size:26.666666666666668px;color:#F1F5F9;font-weight:700;text-align:left;justify-content:center;"><span>가장 흔한 관계</span></div><div class="t" style="left:86.39999999999999px;top:326.4px;width:311.456px;height:96px;font-size:20px;color:#CBD5E1;text-align:left;justify-content:flex-start;"><span>사용자 한 명이 장애 여러 건을 등록한다. 외래키는 N 쪽 테이블에 둔다.</span></div><div class="r" style="left:86.39999999999999px;top:509.76px;width:311.456px;height:80.64000000000001px;background:#0A1322;border-radius:5.76px"></div><div class="t m" style="left:103.67999999999998px;top:509.76px;width:276.896px;height:80.64000000000001px;font-size:16px;color:#2DD4BF;text-align:left;justify-content:center;"><span>incidents.created_by
→ users.id</span></div><div class="r" style="left:455.456px;top:206.39999999999998px;width:369.05600000000004px;height:412.79999999999995px;background:#1A2B45;border-radius:9.600000000000001px"></div><div class="t" style="left:484.256px;top:235.2px;width:311.456px;height:28.799999999999997px;font-size:18.666666666666668px;color:#2DD4BF;font-weight:700;text-align:left;justify-content:center;"><span>N : M</span></div><div class="t" style="left:484.256px;top:273.59999999999997px;width:311.456px;height:40.32px;font-size:26.666666666666668px;color:#F1F5F9;font-weight:700;text-align:left;justify-content:center;"><span>중간 테이블로 푼다</span></div><div class="t" style="left:484.256px;top:326.4px;width:311.456px;height:96px;font-size:20px;color:#CBD5E1;text-align:left;justify-content:flex-start;"><span>장애 하나에 태그 여러 개, 태그 하나에 장애 여러 건. 둘을 잇는 테이블을 따로 만든다.</span></div><div class="r" style="left:484.256px;top:509.76px;width:311.456px;height:80.64000000000001px;background:#0A1322;border-radius:5.76px"></div><div class="t m" style="left:501.53599999999994px;top:509.76px;width:276.896px;height:80.64000000000001px;font-size:16px;color:#2DD4BF;text-align:left;justify-content:center;"><span>incident_tags
(incident_id, tag_id)</span></div><div class="r" style="left:853.3120000000001px;top:206.39999999999998px;width:369.05600000000004px;height:412.79999999999995px;background:#1A2B45;border-radius:9.600000000000001px"></div><div class="t" style="left:882.1120000000001px;top:235.2px;width:311.456px;height:28.799999999999997px;font-size:18.666666666666668px;color:#2DD4BF;font-weight:700;text-align:left;justify-content:center;"><span>1 : 1</span></div><div class="t" style="left:882.1120000000001px;top:273.59999999999997px;width:311.456px;height:40.32px;font-size:26.666666666666668px;color:#F1F5F9;font-weight:700;text-align:left;justify-content:center;"><span>드물게 쓴다</span></div><div class="t" style="left:882.1120000000001px;top:326.4px;width:311.456px;height:96px;font-size:20px;color:#CBD5E1;text-align:left;justify-content:flex-start;"><span>사용자와 프로필처럼 하나씩 짝지어진다. 한 테이블로 합칠 수 있는지 먼저 본다.</span></div><div class="r" style="left:882.1120000000001px;top:509.76px;width:311.456px;height:80.64000000000001px;background:#0A1322;border-radius:5.76px"></div><div class="t m" style="left:899.392px;top:509.76px;width:276.896px;height:80.64000000000001px;font-size:16px;color:#2DD4BF;text-align:left;justify-content:center;"><span>profiles.user_id
→ users.id (UNIQUE)</span></div></section>
<section class="slide"><h2 class="t" style="left:57.599999999999994px;top:43.2px;width:1164.768px;height:86.4px;font-size:42.666666666666664px;color:#F1F5F9;font-weight:700;text-align:left;justify-content:center;"><span>자주 쓰는 타입 여섯 가지</span></h2><div class="t" style="left:57.599999999999994px;top:672px;width:576px;height:28.799999999999997px;font-size:13.333333333333334px;color:#A8B8CC;text-align:left;justify-content:center;"><span>최종 프로젝트 · DB 스키마 설계서 작성법</span></div><div class="t" style="left:1145.568px;top:672px;width:76.80000000000001px;height:28.799999999999997px;font-size:13.333333333333334px;color:#A8B8CC;text-align:right;justify-content:center;"><span>8</span></div><div class="r" style="left:57.599999999999994px;top:168px;width:1164.768px;height:48px;background:#22375A;border-radius:0px"></div><div class="t" style="left:78.72px;top:168px;width:190.71360000000004px;height:48px;font-size:18.666666666666668px;color:#2DD4BF;font-weight:700;text-align:left;justify-content:center;"><span>타입</span></div><div class="t" style="left:311.6736000000001px;top:168px;width:446.96255999999994px;height:48px;font-size:18.666666666666668px;color:#2DD4BF;font-weight:700;text-align:left;justify-content:center;"><span>쓰는 곳</span></div><div class="t" style="left:800.87616px;top:168px;width:400.37184px;height:48px;font-size:18.666666666666668px;color:#2DD4BF;font-weight:700;text-align:left;justify-content:center;"><span>예시</span></div><div class="r" style="left:57.599999999999994px;top:216px;width:1164.768px;height:48px;background:#1A2B45;border-radius:0px"></div><div class="t m" style="left:78.72px;top:216px;width:190.71360000000004px;height:48px;font-size:18.666666666666668px;color:#2DD4BF;text-align:left;justify-content:center;"><span>UUID</span></div><div class="t" style="left:311.6736000000001px;top:216px;width:446.96255999999994px;height:48px;font-size:18.666666666666668px;color:#CBD5E1;text-align:left;justify-content:center;"><span>사용자, 문서 등의 식별자</span></div><div class="t m" style="left:800.87616px;top:216px;width:400.37184px;height:48px;font-size:18.666666666666668px;color:#2DD4BF;text-align:left;justify-content:center;"><span>users.id</span></div><div class="r" style="left:57.599999999999994px;top:264px;width:1164.768px;height:48px;background:#15233A;border-radius:0px"></div><div class="t m" style="left:78.72px;top:264px;width:190.71360000000004px;height:48px;font-size:18.666666666666668px;color:#2DD4BF;text-align:left;justify-content:center;"><span>TEXT</span></div><div class="t" style="left:311.6736000000001px;top:264px;width:446.96255999999994px;height:48px;font-size:18.666666666666668px;color:#CBD5E1;text-align:left;justify-content:center;"><span>문자열. 이름, 상태, 본문</span></div><div class="t m" style="left:800.87616px;top:264px;width:400.37184px;height:48px;font-size:18.666666666666668px;color:#2DD4BF;text-align:left;justify-content:center;"><span>incidents.status</span></div><div class="r" style="left:57.599999999999994px;top:312px;width:1164.768px;height:48px;background:#1A2B45;border-radius:0px"></div><div class="t m" style="left:78.72px;top:312px;width:190.71360000000004px;height:48px;font-size:18.666666666666668px;color:#2DD4BF;text-align:left;justify-content:center;"><span>INT</span></div><div class="t" style="left:311.6736000000001px;top:312px;width:446.96255999999994px;height:48px;font-size:18.666666666666668px;color:#CBD5E1;text-align:left;justify-content:center;"><span>개수, 순번</span></div><div class="t m" style="left:800.87616px;top:312px;width:400.37184px;height:48px;font-size:18.666666666666668px;color:#2DD4BF;text-align:left;justify-content:center;"><span>document_chunks.chunk_index</span></div><div class="r" style="left:57.599999999999994px;top:360px;width:1164.768px;height:48px;background:#15233A;border-radius:0px"></div><div class="t m" style="left:78.72px;top:360px;width:190.71360000000004px;height:48px;font-size:18.666666666666668px;color:#2DD4BF;text-align:left;justify-content:center;"><span>TIMESTAM
<section class="slide"><h2 class="t" style="left:57.599999999999994px;top:43.2px;width:1164.768px;height:86.4px;font-size:42.666666666666664px;color:#F1F5F9;font-weight:700;text-align:left;justify-content:center;"><span>API의 필드에서 테이블을 뽑아낸다</span></h2><div class="t" style="left:57.599999999999994px;top:672px;width:576px;height:28.799999999999997px;font-size:13.333333333333334px;color:#A8B8CC;text-align:left;justify-content:center;"><span>최종 프로젝트 · DB 스키마 설계서 작성법</span></div><div class="t" style="left:1145.568px;top:672px;width:76.80000000000001px;height:28.799999999999997px;font-size:13.333333333333334px;color:#A8B8CC;text-align:right;justify-content:center;"><span>9</span></div><div class="t" style="left:57.599999999999994px;top:134.39999999999998px;width:1164.768px;height:43.2px;font-size:22.666666666666668px;color:#2DD4BF;text-align:left;justify-content:center;"><span>API 설계 문서의 요청·응답 JSON을 펼쳐 놓고, 필드마다 저장할 곳을 정한다</span></div><div class="r" style="left:57.599999999999994px;top:206.39999999999998px;width:1164.768px;height:48px;background:#22375A;border-radius:0px"></div><div class="t" style="left:78.72px;top:206.39999999999998px;width:260.59968000000003px;height:48px;font-size:18.666666666666668px;color:#2DD4BF;font-weight:700;text-align:left;justify-content:center;"><span>API 필드</span></div><div class="t" style="left:381.55968000000007px;top:206.39999999999998px;width:400.37184px;height:48px;font-size:18.666666666666668px;color:#2DD4BF;font-weight:700;text-align:left;justify-content:center;"><span>테이블.컬럼 (예시)</span></div><div class="t" style="left:824.1715200000001px;top:206.39999999999998px;width:377.07648000000006px;height:48px;font-size:18.666666666666668px;color:#2DD4BF;font-weight:700;text-align:left;justify-content:center;"><span>비고</span></div><div class="r" style="left:57.599999999999994px;top:254.39999999999998px;width:1164.768px;height:53.760000000000005px;background:#1A2B45;border-radius:0px"></div><div class="t m" style="left:78.72px;top:254.39999999999998px;width:260.59968000000003px;height:53.760000000000005px;font-size:18.666666666666668px;color:#2DD4BF;text-align:left;justify-content:center;"><span>incident_id</span></div><div class="t m" style="left:381.55968000000007px;top:254.39999999999998px;width:400.37184px;height:53.760000000000005px;font-size:18.666666666666668px;color:#2DD4BF;text-align:left;justify-content:center;"><span>incidents.id</span></div><div class="t" style="left:824.1715200000001px;top:254.39999999999998px;width:377.07648000000006px;height:53.760000000000005px;font-size:18.666666666666668px;color:#CBD5E1;text-align:left;justify-content:center;"><span>경로 파라미터가 곧 기본키</span></div><div class="r" style="left:57.599999999999994px;top:308.15999999999997px;width:1164.768px;height:53.760000000000005px;background:#15233A;border-radius:0px"></div><div class="t m" style="left:78.72px;top:308.15999999999997px;width:260.59968000000003px;height:53.760000000000005px;font-size:18.666666666666668px;color:#2DD4BF;text-align:left;justify-content:center;"><span>action, target_id</span></div><div class="t m" style="left:381.55968000000007px;top:308.15999999999997px;width:400.37184px;height:53.760000000000005px;font-size:18.666666666666668px;color:#2DD4BF;text-align:left;justify-content:center;"><span>recovery_jobs.action, target_id</span></div><div class="t" style="left:824.1715200000001px;top:308.15999999999997px;width:377.07648000000006px;height:53.760000000000005px;font-size:18.666666666666668px;color:#CBD5E1;text-align:left;justify-content:center;"><span>요청 본문을 그대로 기록</span></div><div class="r" style="left:57.599999999999994px;top:361.92px;width:1164.768px;height:53.760000000000005px;background:#1A2B45;border-radius:0px"></div><div class="t m" style="left:78.72px;top:361.92px;width:260.59968000000003px;height:53.760000000000005px;font-size:18.666666666666668px;color:#2DD4BF;text-align:left;justify-content:center;"><span>approval_i
<section class="slide"><h2 class="t" style="left:57.599999999999994px;top:43.2px;width:1164.768px;height:86.4px;font-size:42.666666666666664px;color:#F1F5F9;font-weight:700;text-align:left;justify-content:center;"><span>ERD는 테이블을 상자로, 관계를 선으로 그린다</span></h2><div class="t" style="left:57.599999999999994px;top:672px;width:576px;height:28.799999999999997px;font-size:13.333333333333334px;color:#A8B8CC;text-align:left;justify-content:center;"><span>최종 프로젝트 · DB 스키마 설계서 작성법</span></div><div class="t" style="left:1145.568px;top:672px;width:76.80000000000001px;height:28.799999999999997px;font-size:13.333333333333334px;color:#A8B8CC;text-align:right;justify-content:center;"><span>10</span></div><div class="t" style="left:57.599999999999994px;top:134.39999999999998px;width:1164.768px;height:43.2px;font-size:22.666666666666668px;color:#2DD4BF;text-align:left;justify-content:center;"><span>화살표 하나가 1:N 관계 하나다. 상자 안에는 키 컬럼을 반드시 적는다</span></div><div class="r" style="left:57.599999999999994px;top:240px;width:361.37600000000003px;height:220.79999999999998px;background:#1A2B45;border-radius:9.600000000000001px"></div><div class="t" style="left:72px;top:268.79999999999995px;width:332.576px;height:48px;font-size:24px;color:#F1F5F9;font-weight:700;text-align:center;justify-content:center;"><span>users</span></div><div class="t m" style="left:72px;top:331.20000000000005px;width:332.576px;height:86.4px;font-size:18.666666666666668px;color:#CBD5E1;text-align:center;justify-content:flex-start;"><span>id PK
email UNIQUE</span></div><div class="t" style="left:418.976px;top:240px;width:40.32px;height:220.79999999999998px;font-size:26.666666666666668px;color:#2DD4BF;text-align:center;justify-content:center;"><span>→</span></div><div class="r" style="left:459.29600000000005px;top:240px;width:361.37600000000003px;height:220.79999999999998px;background:#1A2B45;border-radius:9.600000000000001px"></div><div class="t" style="left:473.696px;top:268.79999999999995px;width:332.576px;height:48px;font-size:24px;color:#F1F5F9;font-weight:700;text-align:center;justify-content:center;"><span>incidents</span></div><div class="t m" style="left:473.696px;top:331.20000000000005px;width:332.576px;height:86.4px;font-size:18.666666666666668px;color:#CBD5E1;text-align:center;justify-content:flex-start;"><span>id PK
created_by FK
status</span></div><div class="t" style="left:820.672px;top:240px;width:40.32px;height:220.79999999999998px;font-size:26.666666666666668px;color:#2DD4BF;text-align:center;justify-content:center;"><span>→</span></div><div class="r" style="left:860.9920000000001px;top:240px;width:361.37600000000003px;height:220.79999999999998px;background:#1A2B45;border-radius:9.600000000000001px"></div><div class="t" style="left:875.392px;top:268.79999999999995px;width:332.576px;height:48px;font-size:24px;color:#F1F5F9;font-weight:700;text-align:center;justify-content:center;"><span>recovery_jobs</span></div><div class="t m" style="left:875.392px;top:331.20000000000005px;width:332.576px;height:86.4px;font-size:18.666666666666668px;color:#CBD5E1;text-align:center;justify-content:flex-start;"><span>id PK
incident_id FK
approval_id</span></div><div class="r" style="left:57.599999999999994px;top:513.5999999999999px;width:1164.768px;height:71.03999999999999px;background:#0A1322;border-radius:7.68px"></div><div class="t" style="left:86.39999999999999px;top:513.5999999999999px;width:1107.1680000000001px;height:71.03999999999999px;font-size:18.666666666666668px;color:#CBD5E1;text-align:left;justify-content:center;"><span>그림은 Mermaid erDiagram이나 ERD 도구로 그려서 붙인다. 손으로 그린 그림보다 수정과 버전 관리가 쉽다.</span></div></section>
<section class="slide"><h2 class="t" style="left:57.599999999999994px;top:43.2px;width:1164.768px;height:86.4px;font-size:42.666666666666664px;color:#F1F5F9;font-weight:700;text-align:left;justify-content:center;"><span>관계 명세 표로 그림을 글로 확인한다</span></h2><div class="t" style="left:57.599999999999994px;top:672px;width:576px;height:28.799999999999997px;font-size:13.333333333333334px;color:#A8B8CC;text-align:left;justify-content:center;"><span>최종 프로젝트 · DB 스키마 설계서 작성법</span></div><div class="t" style="left:1145.568px;top:672px;width:76.80000000000001px;height:28.799999999999997px;font-size:13.333333333333334px;color:#A8B8CC;text-align:right;justify-content:center;"><span>11</span></div><div class="r" style="left:57.599999999999994px;top:168px;width:1164.768px;height:48px;background:#22375A;border-radius:0px"></div><div class="t" style="left:78.72px;top:168px;width:190.71360000000004px;height:48px;font-size:18.666666666666668px;color:#2DD4BF;font-weight:700;text-align:left;justify-content:center;"><span>부모 테이블</span></div><div class="t" style="left:311.6736000000001px;top:168px;width:97.53216000000002px;height:48px;font-size:18.666666666666668px;color:#2DD4BF;font-weight:700;text-align:left;justify-content:center;"><span>관계</span></div><div class="t" style="left:451.44576000000006px;top:168px;width:237.30432000000002px;height:48px;font-size:18.666666666666668px;color:#2DD4BF;font-weight:700;text-align:left;justify-content:center;"><span>자식 테이블</span></div><div class="t" style="left:730.9900800000001px;top:168px;width:470.25792px;height:48px;font-size:18.666666666666668px;color:#2DD4BF;font-weight:700;text-align:left;justify-content:center;"><span>연결 키</span></div><div class="r" style="left:57.599999999999994px;top:216px;width:1164.768px;height:67.19999999999999px;background:#1A2B45;border-radius:0px"></div><div class="t m" style="left:78.72px;top:216px;width:190.71360000000004px;height:67.19999999999999px;font-size:18.666666666666668px;color:#2DD4BF;text-align:left;justify-content:center;"><span>users</span></div><div class="t" style="left:311.6736000000001px;top:216px;width:97.53216000000002px;height:67.19999999999999px;font-size:18.666666666666668px;color:#CBD5E1;text-align:left;justify-content:center;"><span>1 : N</span></div><div class="t m" style="left:451.44576000000006px;top:216px;width:237.30432000000002px;height:67.19999999999999px;font-size:18.666666666666668px;color:#2DD4BF;text-align:left;justify-content:center;"><span>incidents</span></div><div class="t m" style="left:730.9900800000001px;top:216px;width:470.25792px;height:67.19999999999999px;font-size:18.666666666666668px;color:#2DD4BF;text-align:left;justify-content:center;"><span>incidents.created_by → users.id</span></div><div class="r" style="left:57.599999999999994px;top:283.20000000000005px;width:1164.768px;height:67.19999999999999px;background:#15233A;border-radius:0px"></div><div class="t m" style="left:78.72px;top:283.20000000000005px;width:190.71360000000004px;height:67.19999999999999px;font-size:18.666666666666668px;color:#2DD4BF;text-align:left;justify-content:center;"><span>incidents</span></div><div class="t" style="left:311.6736000000001px;top:283.20000000000005px;width:97.53216000000002px;height:67.19999999999999px;font-size:18.666666666666668px;color:#CBD5E1;text-align:left;justify-content:center;"><span>1 : N</span></div><div class="t m" style="left:451.44576000000006px;top:283.20000000000005px;width:237.30432000000002px;height:67.19999999999999px;font-size:18.666666666666668px;color:#2DD4BF;text-align:left;justify-content:center;"><span>recovery_jobs</span></div><div class="t m" style="left:730.9900800000001px;top:283.20000000000005px;width:470.25792px;height:67.19999999999999px;font-size:18.666666666666668px;color:#2DD4BF;text-align:left;justify-content:center;"><span>recovery_jobs.incident_id → incidents.id</span></div><div class="r" style="left:57.599999999999994px;top:350.40000000000003px;width:1164.768px;height:67.19999999999999px;background:#1A2B
<section class="slide"><h2 class="t" style="left:57.599999999999994px;top:43.2px;width:1164.768px;height:86.4px;font-size:42.666666666666664px;color:#F1F5F9;font-weight:700;text-align:left;justify-content:center;"><span>엔터티 정의는 컬럼마다 네 칸을 채운다</span></h2><div class="t" style="left:57.599999999999994px;top:672px;width:576px;height:28.799999999999997px;font-size:13.333333333333334px;color:#A8B8CC;text-align:left;justify-content:center;"><span>최종 프로젝트 · DB 스키마 설계서 작성법</span></div><div class="t" style="left:1145.568px;top:672px;width:76.80000000000001px;height:28.799999999999997px;font-size:13.333333333333334px;color:#A8B8CC;text-align:right;justify-content:center;"><span>12</span></div><div class="r" style="left:57.599999999999994px;top:168px;width:1164.768px;height:48px;background:#22375A;border-radius:0px"></div><div class="t" style="left:78.72px;top:168px;width:190.71360000000004px;height:48px;font-size:18.666666666666668px;color:#2DD4BF;font-weight:700;text-align:left;justify-content:center;"><span>테이블</span></div><div class="t" style="left:311.6736000000001px;top:168px;width:190.71360000000004px;height:48px;font-size:18.666666666666668px;color:#2DD4BF;font-weight:700;text-align:left;justify-content:center;"><span>컬럼</span></div><div class="t" style="left:544.6272px;top:168px;width:307.1904px;height:48px;font-size:18.666666666666668px;color:#2DD4BF;font-weight:700;text-align:left;justify-content:center;"><span>타입 / 제약</span></div><div class="t" style="left:894.0576000000001px;top:168px;width:307.1904px;height:48px;font-size:18.666666666666668px;color:#2DD4BF;font-weight:700;text-align:left;justify-content:center;"><span>의미</span></div><div class="r" style="left:57.599999999999994px;top:216px;width:1164.768px;height:48px;background:#1A2B45;border-radius:0px"></div><div class="t m" style="left:78.72px;top:216px;width:190.71360000000004px;height:48px;font-size:18.666666666666668px;color:#2DD4BF;text-align:left;justify-content:center;"><span>users</span></div><div class="t m" style="left:311.6736000000001px;top:216px;width:190.71360000000004px;height:48px;font-size:18.666666666666668px;color:#2DD4BF;text-align:left;justify-content:center;"><span>id</span></div><div class="t m" style="left:544.6272px;top:216px;width:307.1904px;height:48px;font-size:18.666666666666668px;color:#2DD4BF;text-align:left;justify-content:center;"><span>UUID / PK</span></div><div class="t" style="left:894.0576000000001px;top:216px;width:307.1904px;height:48px;font-size:18.666666666666668px;color:#CBD5E1;text-align:left;justify-content:center;"><span>사용자 ID</span></div><div class="r" style="left:57.599999999999994px;top:264px;width:1164.768px;height:48px;background:#15233A;border-radius:0px"></div><div class="t m" style="left:78.72px;top:264px;width:190.71360000000004px;height:48px;font-size:18.666666666666668px;color:#2DD4BF;text-align:left;justify-content:center;"><span>users</span></div><div class="t m" style="left:311.6736000000001px;top:264px;width:190.71360000000004px;height:48px;font-size:18.666666666666668px;color:#2DD4BF;text-align:left;justify-content:center;"><span>email</span></div><div class="t m" style="left:544.6272px;top:264px;width:307.1904px;height:48px;font-size:18.666666666666668px;color:#2DD4BF;text-align:left;justify-content:center;"><span>TEXT / UNIQUE</span></div><div class="t" style="left:894.0576000000001px;top:264px;width:307.1904px;height:48px;font-size:18.666666666666668px;color:#CBD5E1;text-align:left;justify-content:center;"><span>로그인 이메일</span></div><div class="r" style="left:57.599999999999994px;top:312px;width:1164.768px;height:48px;background:#1A2B45;border-radius:0px"></div><div class="t m" style="left:78.72px;top:312px;width:190.71360000000004px;height:48px;font-size:18.666666666666668px;color:#2DD4BF;text-align:left;justify-content:center;"><span>incidents</span></div><div class="t m" style="left:311.6736000000001px;top:312px;width:190.71360000000004px;height:48px;font-size:18.666666666666668px;color:#2DD4BF;text
모든 테이블에 created_at TIMESTAMPTZ를 둔다.</span></div></section>
<section class="slide"><h2 class="t" style="left:57.599999999999994px;top:43.2px;width:1164.768px;height:86.4px;font-size:42.666666666666664px;color:#F1F5F9;font-weight:700;text-align:left;justify-content:center;"><span>설계서의 표는 그대로 SQL이 된다</span></h2><div class="t" style="left:57.599999999999994px;top:672px;width:576px;height:28.799999999999997px;font-size:13.333333333333334px;color:#A8B8CC;text-align:left;justify-content:center;"><span>최종 프로젝트 · DB 스키마 설계서 작성법</span></div><div class="t" style="left:1145.568px;top:672px;width:76.80000000000001px;height:28.799999999999997px;font-size:13.333333333333334px;color:#A8B8CC;text-align:right;justify-content:center;"><span>13</span></div><div class="t ul" style="left:57.599999999999994px;top:172.8px;width:412.79999999999995px;height:441.59999999999997px;font-size:21.333333333333332px;color:#CBD5E1;text-align:left;justify-content:flex-start;--gap:18.666666666666668px;"><div class="li">엔터티 정의 표의 한 행이 SQL의 한 줄이다.</div><div class="li">REFERENCES가 외래키다.</div><div class="li">DEFAULT now()로 생성 시각을 자동 기록한다.</div><div class="li">문서에 싣는 SQL은 Supabase SQL Editor에서 실제로 실행해 본 것만 넣는다.</div></div><div class="r" style="left:508.79999999999995px;top:168px;width:713.5680000000001px;height:424.79999999999995px;background:#0A1322;border-radius:9.600000000000001px"></div><div class="t m" style="left:537.5999999999999px;top:179.52px;width:655.9680000000001px;height:28.799999999999997px;font-size:16px;color:#A8B8CC;text-align:left;justify-content:center;"><span>schema.sql</span></div><div class="t m" style="left:537.5999999999999px;top:216px;width:655.9680000000001px;height:367.2px;font-size:17.333333333333332px;color:#F1F5F9;text-align:left;justify-content:flex-start;"><span>CREATE TABLE incidents (
id TEXT PRIMARY KEY,
created_by UUID NOT NULL REFERENCES users(id),
status TEXT NOT NULL DEFAULT 'detected',
created_at TIMESTAMPTZ NOT NULL DEFAULT now()
);
CREATE TABLE recovery_jobs (
id TEXT PRIMARY KEY,
incident_id TEXT NOT NULL REFERENCES incidents(id),
action TEXT NOT NULL,
approval_id TEXT NOT NULL,
status TEXT NOT NULL DEFAULT 'queued',
created_at TIMESTAMPTZ NOT NULL DEFAULT now()
);</span></div></section>
<section class="slide"><h2 class="t" style="left:57.599999999999994px;top:43.2px;width:1164.768px;height:86.4px;font-size:42.666666666666664px;color:#F1F5F9;font-weight:700;text-align:left;justify-content:center;"><span>pgvector는 문서와 청크를 나눠 저장한다</span></h2><div class="t" style="left:57.599999999999994px;top:672px;width:576px;height:28.799999999999997px;font-size:13.333333333333334px;color:#A8B8CC;text-align:left;justify-content:center;"><span>최종 프로젝트 · DB 스키마 설계서 작성법</span></div><div class="t" style="left:1145.568px;top:672px;width:76.80000000000001px;height:28.799999999999997px;font-size:13.333333333333334px;color:#A8B8CC;text-align:right;justify-content:center;"><span>14</span></div><div class="t" style="left:57.599999999999994px;top:134.39999999999998px;width:1164.768px;height:43.2px;font-size:22.666666666666668px;color:#2DD4BF;text-align:left;justify-content:center;"><span>RAG에 쓰는 지식 문서는 원문 정보와, 잘게 자른 조각(청크)의 벡터로 나뉜다</span></div><div class="r" style="left:57.599999999999994px;top:206.39999999999998px;width:369.05600000000004px;height:412.79999999999995px;background:#1A2B45;border-radius:9.600000000000001px"></div><div class="t" style="left:86.39999999999999px;top:235.2px;width:311.456px;height:28.799999999999997px;font-size:18.666666666666668px;color:#2DD4BF;font-weight:700;text-align:left;justify-content:center;"><span>documents</span></div><div class="t" style="left:86.39999999999999px;top:273.59999999999997px;width:311.456px;height:40.32px;font-size:26.666666666666668px;color:#F1F5F9;font-weight:700;text-align:left;justify-content:center;"><span>원문의 정보</span></div><div class="t" style="left:86.39999999999999px;top:326.4px;width:311.456px;height:96px;font-size:20px;color:#CBD5E1;text-align:left;justify-content:flex-start;"><span>제목, 출처, 부가 정보를 저장한다. 청크가 어느 문서에서 나왔는지 추적하는 기준이다.</span></div><div class="r" style="left:86.39999999999999px;top:509.76px;width:311.456px;height:80.64000000000001px;background:#0A1322;border-radius:5.76px"></div><div class="t m" style="left:103.67999999999998px;top:509.76px;width:276.896px;height:80.64000000000001px;font-size:16px;color:#2DD4BF;text-align:left;justify-content:center;"><span>documents
(title, source_uri)</span></div><div class="r" style="left:455.456px;top:206.39999999999998px;width:369.05600000000004px;height:412.79999999999995px;background:#1A2B45;border-radius:9.600000000000001px"></div><div class="t" style="left:484.256px;top:235.2px;width:311.456px;height:28.799999999999997px;font-size:18.666666666666668px;color:#2DD4BF;font-weight:700;text-align:left;justify-content:center;"><span>document_chunks</span></div><div class="t" style="left:484.256px;top:273.59999999999997px;width:311.456px;height:40.32px;font-size:26.666666666666668px;color:#F1F5F9;font-weight:700;text-align:left;justify-content:center;"><span>조각과 벡터</span></div><div class="t" style="left:484.256px;top:326.4px;width:311.456px;height:96px;font-size:20px;color:#CBD5E1;text-align:left;justify-content:flex-start;"><span>잘라 낸 본문과 임베딩 벡터, 문서 안에서의 순번을 저장한다. 검색은 이 테이블에서 일어난다.</span></div><div class="r" style="left:484.256px;top:509.76px;width:311.456px;height:80.64000000000001px;background:#0A1322;border-radius:5.76px"></div><div class="t m" style="left:501.53599999999994px;top:509.76px;width:276.896px;height:80.64000000000001px;font-size:16px;color:#2DD4BF;text-align:left;justify-content:center;"><span>document_chunks
(content, embedding)</span></div><div class="r" style="left:853.3120000000001px;top:206.39999999999998px;width:369.05600000000004px;height:412.79999999999995px;background:#1A2B45;border-radius:9.600000000000001px"></div><div class="t" style="left:882.1120000000001px;top:235.2px;width:311.456px;height:28.799999999999997px;font-size:18.666666666666668px;color:#2DD4BF;font-weight:700;text-align:left;justify-content:center;"><span>모델 정보</span></div><div class="t" style="left:882.1120000000001px;top:273.59999999999997px;width:311.456px;height:40.32px;font-size:26.666666666666668px;color:#F1F5F9;font-weight:700;text-align:left;justify-content:center;"><span>어떤 모델로 만들었나</span></div><div class="t" style="left:882.1120000000001px;top:326.4px;width:311.456px;height:96px;font-size:20px;color:#CBD5E1;text-align:left;justify-content:flex-start;"><span>모델을 바꾸면 벡터의 차원과 의미가 달라진다. 기존 벡터와 섞어 쓸 수 없으므로 기록해 둔다.</span></div><div class="r" style="left:882.1120000000001px;top:509.76px;width:311.456px;height:80.64000000000001px;background:#0A1322;border-radius:5.76px"></div><div class="t m" style="left:899.392px;top:509.76px;width:276.896px;height:80.64000000000001px;font-size:16px;color:#2DD4BF;text-align:left;justify-content:center;"><span>embedding_model
embedding_version</span></div></section>
<section class="slide"><h2 class="t" style="left:57.599999999999994px;top:43.2px;width:1164.768px;height:86.4px;font-size:42.666666666666664px;color:#F1F5F9;font-weight:700;text-align:left;justify-content:center;"><span>벡터 컬럼과 인덱스를 명세한다</span></h2><div class="t" style="left:57.599999999999994px;top:672px;width:576px;height:28.799999999999997px;font-size:13.333333333333334px;color:#A8B8CC;text-align:left;justify-content:center;"><span>최종 프로젝트 · DB 스키마 설계서 작성법</span></div><div class="t" style="left:1145.568px;top:672px;width:76.80000000000001px;height:28.799999999999997px;font-size:13.333333333333334px;color:#A8B8CC;text-align:right;justify-content:center;"><span>15</span></div><div class="t ul" style="left:57.599999999999994px;top:172.8px;width:412.79999999999995px;height:441.59999999999997px;font-size:21.333333333333332px;color:#CBD5E1;text-align:left;justify-content:flex-start;--gap:18.666666666666668px;"><div class="li">VECTOR(n)의 n은 임베딩 모델의 출력 차원과 같아야 한다.</div><div class="li">인덱스의 연산자(vector_cosine_ops)와 검색식의 연산자(&lt;=&gt;)를 맞춘다.</div><div class="li">UNIQUE (document_id, chunk_index)로 같은 조각이 두 번 적재되지 않게 한다.</div></div><div class="r" style="left:508.79999999999995px;top:168px;width:713.5680000000001px;height:448.32px;background:#0A1322;border-radius:9.600000000000001px"></div><div class="t m" style="left:537.5999999999999px;top:179.52px;width:655.9680000000001px;height:28.799999999999997px;font-size:16px;color:#A8B8CC;text-align:left;justify-content:center;"><span>pgvector 스키마</span></div><div class="t m" style="left:537.5999999999999px;top:216px;width:655.9680000000001px;height:390.72px;font-size:17.333333333333332px;color:#F1F5F9;text-align:left;justify-content:flex-start;"><span>CREATE TABLE document_chunks (
id UUID PRIMARY KEY,
document_id UUID NOT NULL REFERENCES documents(id),
chunk_index INT NOT NULL,
content TEXT NOT NULL,
embedding VECTOR(1536),
UNIQUE (document_id, chunk_index)
);
CREATE INDEX idx_chunks_embedding
ON document_chunks
USING hnsw (embedding vector_cosine_ops);
-- 검색: 코사인 거리가 가까운 순서로 5건
SELECT content FROM document_chunks
ORDER BY embedding &lt;=&gt; :query_vec LIMIT 5;</span></div></section>
<section class="slide"><h2 class="t" style="left:57.599999999999994px;top:43.2px;width:1164.768px;height:86.4px;font-size:42.666666666666664px;color:#F1F5F9;font-weight:700;text-align:left;justify-content:center;"><span>RLS 정책은 역할과 명령의 표로 적는다</span></h2><div class="t" style="left:57.599999999999994px;top:672px;width:576px;height:28.799999999999997px;font-size:13.333333333333334px;color:#A8B8CC;text-align:left;justify-content:center;"><span>최종 프로젝트 · DB 스키마 설계서 작성법</span></div><div class="t" style="left:1145.568px;top:672px;width:76.80000000000001px;height:28.799999999999997px;font-size:13.333333333333334px;color:#A8B8CC;text-align:right;justify-content:center;"><span>16</span></div><div class="t" style="left:57.599999999999994px;top:134.39999999999998px;width:1164.768px;height:43.2px;font-size:22.666666666666668px;color:#2DD4BF;text-align:left;justify-content:center;"><span>RLS(Row Level Security)는 행 단위 권한이다. 같은 테이블이라도 사용자마다 보이는 행이 다르다</span></div><div class="r" style="left:57.599999999999994px;top:206.39999999999998px;width:1164.768px;height:48px;background:#22375A;border-radius:0px"></div><div class="t" style="left:78.72px;top:206.39999999999998px;width:190.71360000000004px;height:48px;font-size:18.666666666666668px;color:#2DD4BF;font-weight:700;text-align:left;justify-content:center;"><span>테이블</span></div><div class="t" style="left:311.6736000000001px;top:206.39999999999998px;width:260.59968000000003px;height:48px;font-size:18.666666666666668px;color:#2DD4BF;font-weight:700;text-align:left;justify-content:center;"><span>SELECT</span></div><div class="t" style="left:614.5132800000001px;top:206.39999999999998px;width:190.71360000000004px;height:48px;font-size:18.666666666666668px;color:#2DD4BF;font-weight:700;text-align:left;justify-content:center;"><span>INSERT</span></div><div class="t" style="left:847.4668800000002px;top:206.39999999999998px;width:155.77056000000005px;height:48px;font-size:18.666666666666668px;color:#2DD4BF;font-weight:700;text-align:left;justify-content:center;"><span>UPDATE</span></div><div class="t" style="left:1045.4774400000001px;top:206.39999999999998px;width:155.77056000000005px;height:48px;font-size:18.666666666666668px;color:#2DD4BF;font-weight:700;text-align:left;justify-content:center;"><span>DELETE</span></div><div class="r" style="left:57.599999999999994px;top:254.39999999999998px;width:1164.768px;height:59.519999999999996px;background:#1A2B45;border-radius:0px"></div><div class="t m" style="left:78.72px;top:254.39999999999998px;width:190.71360000000004px;height:59.519999999999996px;font-size:18.666666666666668px;color:#2DD4BF;text-align:left;justify-content:center;"><span>incidents</span></div><div class="t" style="left:311.6736000000001px;top:254.39999999999998px;width:260.59968000000003px;height:59.519999999999996px;font-size:18.666666666666668px;color:#CBD5E1;text-align:left;justify-content:center;"><span>viewer는 본인 것, 운영자는 전체</span></div><div class="t" style="left:614.5132800000001px;top:254.39999999999998px;width:190.71360000000004px;height:59.519999999999996px;font-size:18.666666666666668px;color:#CBD5E1;text-align:left;justify-content:center;"><span>operator / admin</span></div><div class="t" style="left:847.4668800000002px;top:254.39999999999998px;width:155.77056000000005px;height:59.519999999999996px;font-size:18.666666666666668px;color:#CBD5E1;text-align:left;justify-content:center;"><span>operator / admin</span></div><div class="t" style="left:1045.4774400000001px;top:254.39999999999998px;width:155.77056000000005px;height:59.519999999999996px;font-size:18.666666666666668px;color:#CBD5E1;text-align:left;justify-content:center;"><span>admin</span></div><div class="r" style="left:57.599999999999994px;top:313.92px;width:1164.768px;height:59.519999999999996px;background:#15233A;border-radius:0px"></div><div class="t m" style="left:78.72px;top:313.92px;width:190.71360000000004px;height:59.519999999999996px;font-size:18.666666666666668px;co
<section class="slide"><h2 class="t" style="left:57.599999999999994px;top:43.2px;width:1164.768px;height:86.4px;font-size:42.666666666666664px;color:#F1F5F9;font-weight:700;text-align:left;justify-content:center;"><span>RLS 표는 정책 SQL로 옮긴다</span></h2><div class="t" style="left:57.599999999999994px;top:672px;width:576px;height:28.799999999999997px;font-size:13.333333333333334px;color:#A8B8CC;text-align:left;justify-content:center;"><span>최종 프로젝트 · DB 스키마 설계서 작성법</span></div><div class="t" style="left:1145.568px;top:672px;width:76.80000000000001px;height:28.799999999999997px;font-size:13.333333333333334px;color:#A8B8CC;text-align:right;justify-content:center;"><span>17</span></div><div class="t ul" style="left:57.599999999999994px;top:172.8px;width:412.79999999999995px;height:441.59999999999997px;font-size:21.333333333333332px;color:#CBD5E1;text-align:left;justify-content:flex-start;--gap:18.666666666666668px;"><div class="li">RLS를 켜면 정책에 없는 접근은 모두 거부된다.</div><div class="li">auth.uid()는 요청에 실린 JWT의 사용자 ID다.</div><div class="li">service_role 키는 RLS를 건너뛴다. 서버에만 두고 브라우저에 노출하지 않는다.</div><div class="li">다른 사용자의 토큰으로 조회해 0건이 나오는지 테스트한다.</div></div><div class="r" style="left:508.79999999999995px;top:168px;width:713.5680000000001px;height:377.76px;background:#0A1322;border-radius:9.600000000000001px"></div><div class="t m" style="left:537.5999999999999px;top:179.52px;width:655.9680000000001px;height:28.799999999999997px;font-size:16px;color:#A8B8CC;text-align:left;justify-content:center;"><span>Supabase RLS (형식 예시)</span></div><div class="t m" style="left:537.5999999999999px;top:216px;width:655.9680000000001px;height:320.15999999999997px;font-size:17.333333333333332px;color:#F1F5F9;text-align:left;justify-content:flex-start;"><span>ALTER TABLE incidents ENABLE ROW LEVEL SECURITY;
-- 본인이 등록한 장애만 조회
CREATE POLICY incidents_select_own
ON incidents FOR SELECT
TO authenticated
USING (created_by = auth.uid());
-- 자기 이름으로만 등록
CREATE POLICY incidents_insert_own
ON incidents FOR INSERT
TO authenticated
WITH CHECK (created_by = auth.uid());</span></div></section>
<section class="slide"><h2 class="t" style="left:57.599999999999994px;top:43.2px;width:1164.768px;height:86.4px;font-size:42.666666666666664px;color:#F1F5F9;font-weight:700;text-align:left;justify-content:center;"><span>JWT와 Redis 세션의 수명주기를 적는다</span></h2><div class="t" style="left:57.599999999999994px;top:672px;width:576px;height:28.799999999999997px;font-size:13.333333333333334px;color:#A8B8CC;text-align:left;justify-content:center;"><span>최종 프로젝트 · DB 스키마 설계서 작성법</span></div><div class="t" style="left:1145.568px;top:672px;width:76.80000000000001px;height:28.799999999999997px;font-size:13.333333333333334px;color:#A8B8CC;text-align:right;justify-content:center;"><span>18</span></div><div class="t" style="left:57.599999999999994px;top:134.39999999999998px;width:1164.768px;height:43.2px;font-size:22.666666666666668px;color:#2DD4BF;text-align:left;justify-content:center;"><span>PostgreSQL 밖에 저장하는 데이터도 스키마다. 키 이름 규칙과 만료 시간을 문서에 남긴다</span></div><div class="r" style="left:57.599999999999994px;top:240px;width:200.69760000000002px;height:220.79999999999998px;background:#1A2B45;border-radius:9.600000000000001px"></div><div class="t" style="left:72px;top:268.79999999999995px;width:171.8976px;height:48px;font-size:24px;color:#F1F5F9;font-weight:700;text-align:center;justify-content:center;"><span>① 발급</span></div><div class="t" style="left:72px;top:331.20000000000005px;width:171.8976px;height:86.4px;font-size:18.666666666666668px;color:#CBD5E1;text-align:center;justify-content:flex-start;"><span>Supabase Auth가
JWT 발급</span></div><div class="t" style="left:258.29760000000005px;top:240px;width:40.32px;height:220.79999999999998px;font-size:26.666666666666668px;color:#2DD4BF;text-align:center;justify-content:center;"><span>→</span></div><div class="r" style="left:298.61760000000004px;top:240px;width:200.69760000000002px;height:220.79999999999998px;background:#1A2B45;border-radius:9.600000000000001px"></div><div class="t" style="left:313.0176px;top:268.79999999999995px;width:171.8976px;height:48px;font-size:24px;color:#F1F5F9;font-weight:700;text-align:center;justify-content:center;"><span>② 검증</span></div><div class="t" style="left:313.0176px;top:331.20000000000005px;width:171.8976px;height:86.4px;font-size:18.666666666666668px;color:#CBD5E1;text-align:center;justify-content:flex-start;"><span>서명·만료·역할
확인</span></div><div class="t" style="left:499.3152px;top:240px;width:40.32px;height:220.79999999999998px;font-size:26.666666666666668px;color:#2DD4BF;text-align:center;justify-content:center;"><span>→</span></div><div class="r" style="left:539.6351999999999px;top:240px;width:200.69760000000002px;height:220.79999999999998px;background:#0F766E;border-radius:9.600000000000001px"></div><div class="t" style="left:554.0352px;top:268.79999999999995px;width:171.8976px;height:48px;font-size:24px;color:#F1F5F9;font-weight:700;text-align:center;justify-content:center;"><span>③ 저장</span></div><div class="t m" style="left:554.0352px;top:331.20000000000005px;width:171.8976px;height:86.4px;font-size:18.666666666666668px;color:#F1F5F9;text-align:center;justify-content:flex-start;"><span>session:{id}
TTL 30분</span></div><div class="t" style="left:740.3328px;top:240px;width:40.32px;height:220.79999999999998px;font-size:26.666666666666668px;color:#2DD4BF;text-align:center;justify-content:center;"><span>→</span></div><div class="r" style="left:780.6528000000001px;top:240px;width:200.69760000000002px;height:220.79999999999998px;background:#1A2B45;border-radius:9.600000000000001px"></div><div class="t" style="left:795.0528px;top:268.79999999999995px;width:171.8976px;height:48px;font-size:24px;color:#F1F5F9;font-weight:700;text-align:center;justify-content:center;"><span>④ 갱신</span></div><div class="t" style="left:795.0528px;top:331.20000000000005px;width:171.8976px;height:86.4px;font-size:18.666666666666668px;color:#CBD5E1;text-align:center;justify-content:flex-start;"><span>요청마다 TTL
갱신 정책 적용</span></div><div class="t" style="left:981.3504px;top:240px;width:40.32px;height:220.79999999999998px;font-size:26.666666666666668px;color:#2DD4BF;text-align:center;justify-content:center;"><span>→</span></div><div class="r" style="left:1021.6704px;top:240px;width:200.69760000000002px;height:220.79999999999998px;background:#1A2B45;border-radius:9.600000000000001px"></div><div class="t" style="left:1036.0704px;top:268.79999999999995px;width:171.8976px;height:48px;font-size:24px;color:#F1F5F9;font-weight:700;text-align:center;justify-content:center;"><span>⑤ 폐기</span></div><div class="t" style="left:1036.0704px;top:331.20000000000005px;width:171.8976px;height:86.4px;font-size:18.666666666666668px;color:#CBD5E1;text-align:center;justify-content:flex-start;"><span>로그아웃·만료 시
세션 삭제</span></div><div class="r" style="left:57.599999999999994px;top:513.5999999999999px;width:1164.768px;height:71.03999999999999px;background:#0A1322;border-radius:7.68px"></div><div class="t" style="left:86.39999999999999px;top:513.5999999999999px;width:1107.1680000000001px;height:71.03999999999999px;font-size:18.666666666666668px;color:#CBD5E1;text-align:left;justify-content:center;"><span>JWT의 만료 시간과 Redis의 TTL은 서로 다른 값이다. 둘 다 적고, 어느 쪽이 먼저 끝나면 어떻게 되는지도 적는다.</span></div></section>
<section class="slide"><h2 class="t" style="left:57.599999999999994px;top:43.2px;width:1164.768px;height:86.4px;font-size:42.666666666666664px;color:#F1F5F9;font-weight:700;text-align:left;justify-content:center;"><span>인덱스는 자주 쓰는 조회에서 출발한다</span></h2><div class="t" style="left:57.599999999999994px;top:672px;width:576px;height:28.799999999999997px;font-size:13.333333333333334px;color:#A8B8CC;text-align:left;justify-content:center;"><span>최종 프로젝트 · DB 스키마 설계서 작성법</span></div><div class="t" style="left:1145.568px;top:672px;width:76.80000000000001px;height:28.799999999999997px;font-size:13.333333333333334px;color:#A8B8CC;text-align:right;justify-content:center;"><span>19</span></div><div class="r" style="left:57.599999999999994px;top:168px;width:567.984px;height:225.60000000000002px;background:#1A2B45;border-radius:9.600000000000001px"></div><div class="t" style="left:86.39999999999999px;top:196.79999999999998px;width:510.384px;height:40.32px;font-size:26.666666666666668px;color:#F1F5F9;font-weight:700;text-align:left;justify-content:center;"><span>API 목록의 GET부터 본다</span></div><div class="t" style="left:86.39999999999999px;top:249.59999999999997px;width:510.384px;height:38.400000000000006px;font-size:20px;color:#CBD5E1;text-align:left;justify-content:flex-start;"><span>어떤 조건으로 찾고 정렬하는가.</span></div><div class="r" style="left:86.39999999999999px;top:310.0799999999999px;width:510.384px;height:54.720000000000006px;background:#0A1322;border-radius:5.76px"></div><div class="t m" style="left:103.67999999999998px;top:310.0799999999999px;width:475.824px;height:54.720000000000006px;font-size:18.666666666666668px;color:#2DD4BF;text-align:left;justify-content:center;"><span>GET /incidents?status=open</span></div><div class="r" style="left:654.384px;top:168px;width:567.984px;height:225.60000000000002px;background:#1A2B45;border-radius:9.600000000000001px"></div><div class="t" style="left:683.184px;top:196.79999999999998px;width:510.384px;height:40.32px;font-size:26.666666666666668px;color:#F1F5F9;font-weight:700;text-align:left;justify-content:center;"><span>조건과 정렬을 묶어 만든다</span></div><div class="t" style="left:683.184px;top:249.59999999999997px;width:510.384px;height:38.400000000000006px;font-size:20px;color:#CBD5E1;text-align:left;justify-content:flex-start;"><span>필터 컬럼 먼저, 정렬 컬럼 다음.</span></div><div class="r" style="left:683.184px;top:310.0799999999999px;width:510.384px;height:54.720000000000006px;background:#0A1322;border-radius:5.76px"></div><div class="t m" style="left:700.4639999999999px;top:310.0799999999999px;width:475.824px;height:54.720000000000006px;font-size:18.666666666666668px;color:#2DD4BF;text-align:left;justify-content:center;"><span>INDEX incidents (status, created_at DESC)</span></div><div class="r" style="left:57.599999999999994px;top:422.40000000000003px;width:567.984px;height:225.60000000000002px;background:#1A2B45;border-radius:9.600000000000001px"></div><div class="t" style="left:86.39999999999999px;top:451.20000000000005px;width:510.384px;height:40.32px;font-size:26.666666666666668px;color:#F1F5F9;font-weight:700;text-align:left;justify-content:center;"><span>실행 계획으로 확인한다</span></div><div class="t" style="left:86.39999999999999px;top:504px;width:510.384px;height:38.400000000000006px;font-size:20px;color:#CBD5E1;text-align:left;justify-content:flex-start;"><span>인덱스 전후 결과를 문서에 싣는다.</span></div><div class="r" style="left:86.39999999999999px;top:564.48px;width:510.384px;height:54.720000000000006px;background:#0A1322;border-radius:5.76px"></div><div class="t m" style="left:103.67999999999998px;top:564.48px;width:475.824px;height:54.720000000000006px;font-size:18.666666666666668px;color:#2DD4BF;text-align:left;justify-content:center;"><span>EXPLAIN ANALYZE SELECT …</span></div><div class="r" style="left:654.384px;top:422.40000000000003px;width:567.984px;height:225.60000000000002px;background:#1A2B45;border-radius:9.60
<section class="slide"><h2 class="t" style="left:57.599999999999994px;top:43.2px;width:1164.768px;height:86.4px;font-size:42.666666666666664px;color:#F1F5F9;font-weight:700;text-align:left;justify-content:center;"><span>다른 산출물과 같은 이름을 쓴다</span></h2><div class="t" style="left:57.599999999999994px;top:672px;width:576px;height:28.799999999999997px;font-size:13.333333333333334px;color:#A8B8CC;text-align:left;justify-content:center;"><span>최종 프로젝트 · DB 스키마 설계서 작성법</span></div><div class="t" style="left:1145.568px;top:672px;width:76.80000000000001px;height:28.799999999999997px;font-size:13.333333333333334px;color:#A8B8CC;text-align:right;justify-content:center;"><span>20</span></div><div class="t" style="left:57.599999999999994px;top:134.39999999999998px;width:1164.768px;height:43.2px;font-size:22.666666666666668px;color:#2DD4BF;text-align:left;justify-content:center;"><span>DB 스키마는 거의 모든 산출물이 참조한다. 이름이 어긋나면 전체가 어긋난다</span></div><div class="r" style="left:57.599999999999994px;top:206.39999999999998px;width:567.984px;height:206.39999999999998px;background:#1A2B45;border-radius:9.600000000000001px"></div><div class="t" style="left:86.39999999999999px;top:235.2px;width:510.384px;height:28.799999999999997px;font-size:18.666666666666668px;color:#2DD4BF;font-weight:700;text-align:left;justify-content:center;"><span>API 설계 문서</span></div><div class="t" style="left:86.39999999999999px;top:273.59999999999997px;width:510.384px;height:40.32px;font-size:26.666666666666668px;color:#F1F5F9;font-weight:700;text-align:left;justify-content:center;"><span>필드명과 컬럼명을 맞춘다</span></div><div class="t" style="left:86.39999999999999px;top:326.4px;width:510.384px;height:57.60000000000005px;font-size:20px;color:#CBD5E1;text-align:left;justify-content:flex-start;"><span>incident_id, approval_id와 ID 형식을 똑같이 쓴다.</span></div><div class="r" style="left:654.384px;top:206.39999999999998px;width:567.984px;height:206.39999999999998px;background:#1A2B45;border-radius:9.600000000000001px"></div><div class="t" style="left:683.184px;top:235.2px;width:510.384px;height:28.799999999999997px;font-size:18.666666666666668px;color:#2DD4BF;font-weight:700;text-align:left;justify-content:center;"><span>에이전트 설계서</span></div><div class="t" style="left:683.184px;top:273.59999999999997px;width:510.384px;height:40.32px;font-size:26.666666666666668px;color:#F1F5F9;font-weight:700;text-align:left;justify-content:center;"><span>메모리가 저장되는 곳</span></div><div class="t" style="left:683.184px;top:326.4px;width:510.384px;height:57.60000000000005px;font-size:20px;color:#CBD5E1;text-align:left;justify-content:flex-start;"><span>체크포인트와 장기 메모리(pgvector)의 테이블을 밝힌다.</span></div><div class="r" style="left:57.599999999999994px;top:441.59999999999997px;width:567.984px;height:206.39999999999998px;background:#1A2B45;border-radius:9.600000000000001px"></div><div class="t" style="left:86.39999999999999px;top:470.4px;width:510.384px;height:28.799999999999997px;font-size:18.666666666666668px;color:#2DD4BF;font-weight:700;text-align:left;justify-content:center;"><span>AI 보안 가드레일 문서</span></div><div class="t" style="left:86.39999999999999px;top:508.79999999999995px;width:510.384px;height:40.32px;font-size:26.666666666666668px;color:#F1F5F9;font-weight:700;text-align:left;justify-content:center;"><span>RLS 표가 권한표다</span></div><div class="t" style="left:86.39999999999999px;top:561.5999999999999px;width:510.384px;height:57.60000000000005px;font-size:20px;color:#CBD5E1;text-align:left;justify-content:flex-start;"><span>역할별 권한이 두 문서에서 같아야 한다.</span></div><div class="r" style="left:654.384px;top:441.59999999999997px;width:567.984px;height:206.39999999999998px;background:#1A2B45;border-radius:9.600000000000001px"></div><div class="t" style="left:683.184px;top:470.4px;width:510.384px;height:28.799999999999997px;font-size:18
<section class="slide"><h2 class="t" style="left:57.599999999999994px;top:43.2px;width:1164.768px;height:86.4px;font-size:42.666666666666664px;color:#F1F5F9;font-weight:700;text-align:left;justify-content:center;"><span>자주 나오는 실수와 고치는 법</span></h2><div class="t" style="left:57.599999999999994px;top:672px;width:576px;height:28.799999999999997px;font-size:13.333333333333334px;color:#A8B8CC;text-align:left;justify-content:center;"><span>최종 프로젝트 · DB 스키마 설계서 작성법</span></div><div class="t" style="left:1145.568px;top:672px;width:76.80000000000001px;height:28.799999999999997px;font-size:13.333333333333334px;color:#A8B8CC;text-align:right;justify-content:center;"><span>21</span></div><div class="r" style="left:57.599999999999994px;top:168px;width:1164.768px;height:48px;background:#22375A;border-radius:0px"></div><div class="t" style="left:78.72px;top:168px;width:540.144px;height:48px;font-size:18.666666666666668px;color:#2DD4BF;font-weight:700;text-align:left;justify-content:center;"><span>실수</span></div><div class="t" style="left:661.104px;top:168px;width:540.144px;height:48px;font-size:18.666666666666668px;color:#2DD4BF;font-weight:700;text-align:left;justify-content:center;"><span>이렇게 고친다</span></div><div class="r" style="left:57.599999999999994px;top:216px;width:1164.768px;height:74.88px;background:#1A2B45;border-radius:0px"></div><div class="t" style="left:78.72px;top:216px;width:540.144px;height:74.88px;font-size:18.666666666666668px;color:#F1F5F9;font-weight:700;text-align:left;justify-content:center;"><span>같은 컬럼이 문서 안에서 이름이 다르다
(created_by 와 owner_id)</span></div><div class="t" style="left:661.104px;top:216px;width:540.144px;height:74.88px;font-size:18.666666666666668px;color:#CBD5E1;text-align:left;justify-content:center;"><span>엔터티 정의 표를 기준으로 삼아 ERD와 관계 표를 맞춘다</span></div><div class="r" style="left:57.599999999999994px;top:290.88px;width:1164.768px;height:74.88px;background:#15233A;border-radius:0px"></div><div class="t" style="left:78.72px;top:290.88px;width:540.144px;height:74.88px;font-size:18.666666666666668px;color:#F1F5F9;font-weight:700;text-align:left;justify-content:center;"><span>ID 형식이 API 문서와 다르다
(UUID라고 적고 예시는 inc-001)</span></div><div class="t" style="left:661.104px;top:290.88px;width:540.144px;height:74.88px;font-size:18.666666666666668px;color:#CBD5E1;text-align:left;justify-content:center;"><span>형식을 하나로 정하고 두 문서를 함께 고친다</span></div><div class="r" style="left:57.599999999999994px;top:365.76000000000005px;width:1164.768px;height:74.88px;background:#1A2B45;border-radius:0px"></div><div class="t" style="left:78.72px;top:365.76000000000005px;width:540.144px;height:74.88px;font-size:18.666666666666668px;color:#F1F5F9;font-weight:700;text-align:left;justify-content:center;"><span>ERD 그림만 있고 제약이 없다</span></div><div class="t" style="left:661.104px;top:365.76000000000005px;width:540.144px;height:74.88px;font-size:18.666666666666668px;color:#CBD5E1;text-align:left;justify-content:center;"><span>PK·FK·NOT NULL·UNIQUE를 컬럼마다 적는다</span></div><div class="r" style="left:57.599999999999994px;top:440.6400000000001px;width:1164.768px;height:74.88px;background:#15233A;border-radius:0px"></div><div class="t" style="left:78.72px;top:440.6400000000001px;width:540.144px;height:74.88px;font-size:18.666666666666668px;color:#F1F5F9;font-weight:700;text-align:left;justify-content:center;"><span>임베딩 모델의 차원과 VECTOR(n)이 다르다</span></div><div class="t" style="left:661.104px;top:440.6400000000001px;width:540.144px;height:74.88px;font-size:18.666666666666668px;color:#CBD5E1;text-align:left;justify-content:center;"><span>모델 이름과 차원을 컬럼 옆에 함께 기록한다</span></div><div class="r" style="left:57.599999999999994px;top:515.5200000000001px;width:1164.768px;height:74.88px;background:#1A2B45;border-radius:0px"></div><div class="t" style="left:78.72px;top:515.5200000000001px;width:540.144px;height:74.88px;font-size:18.666666666666668px;color:#F1F5F9;font-weight:700;text-align:left;justify-content:center;"><span>RLS를 켜지 않고 service_role로만 접근한다</span></div><div class="t" style="left:661.104px;top:515.5200000000001px;width:540.144px;height:74.88px;font-size:18.666666666666668px;color:#CBD5E1;text-align:left;justify-content:center;"><span>테이블마다 RLS 표를 만들고 차단 테스트를 남긴다</span></div></section>
<section class="slide"><h2 class="t" style="left:57.599999999999994px;top:43.2px;width:1164.768px;height:86.4px;font-size:42.666666666666664px;color:#F1F5F9;font-weight:700;text-align:left;justify-content:center;"><span>제출 전 체크리스트</span></h2><div class="t" style="left:57.599999999999994px;top:672px;width:576px;height:28.799999999999997px;font-size:13.333333333333334px;color:#A8B8CC;text-align:left;justify-content:center;"><span>최종 프로젝트 · DB 스키마 설계서 작성법</span></div><div class="t" style="left:1145.568px;top:672px;width:76.80000000000001px;height:28.799999999999997px;font-size:13.333333333333334px;color:#A8B8CC;text-align:right;justify-content:center;"><span>22</span></div><div class="r" style="left:57.599999999999994px;top:168px;width:570.384px;height:91.19999999999999px;background:#1A2B45;border-radius:9.600000000000001px"></div><div class="r" style="left:86.39999999999999px;top:199.20000000000002px;width:28.799999999999997px;height:28.799999999999997px;background:#1A2B45;border:1.6px solid #2DD4BF;border-radius:3.84px"></div><div class="t" style="left:139.2px;top:168px;width:464.784px;height:91.19999999999999px;font-size:20px;color:#F1F5F9;text-align:left;justify-content:center;"><span>ERD 그림과 관계 명세 표가 서로 일치한다</span></div><div class="r" style="left:57.599999999999994px;top:283.20000000000005px;width:570.384px;height:91.19999999999999px;background:#1A2B45;border-radius:9.600000000000001px"></div><div class="r" style="left:86.39999999999999px;top:314.40000000000003px;width:28.799999999999997px;height:28.799999999999997px;background:#1A2B45;border:1.6px solid #2DD4BF;border-radius:3.84px"></div><div class="t" style="left:139.2px;top:283.20000000000005px;width:464.784px;height:91.19999999999999px;font-size:20px;color:#F1F5F9;text-align:left;justify-content:center;"><span>모든 컬럼에 타입·제약·의미가 적혀 있다</span></div><div class="r" style="left:57.599999999999994px;top:398.40000000000003px;width:570.384px;height:91.19999999999999px;background:#1A2B45;border-radius:9.600000000000001px"></div><div class="r" style="left:86.39999999999999px;top:429.59999999999997px;width:28.799999999999997px;height:28.799999999999997px;background:#1A2B45;border:1.6px solid #2DD4BF;border-radius:3.84px"></div><div class="t" style="left:139.2px;top:398.40000000000003px;width:464.784px;height:91.19999999999999px;font-size:20px;color:#F1F5F9;text-align:left;justify-content:center;"><span>모든 테이블에 기본키와 created_at이 있다</span></div><div class="r" style="left:57.599999999999994px;top:513.5999999999999px;width:570.384px;height:91.19999999999999px;background:#1A2B45;border-radius:9.600000000000001px"></div><div class="r" style="left:86.39999999999999px;top:544.8px;width:28.799999999999997px;height:28.799999999999997px;background:#1A2B45;border:1.6px solid #2DD4BF;border-radius:3.84px"></div><div class="t" style="left:139.2px;top:513.5999999999999px;width:464.784px;height:91.19999999999999px;font-size:20px;color:#F1F5F9;text-align:left;justify-content:center;"><span>API 설계 문서와 필드명·ID 형식이 같다</span></div><div class="r" style="left:651.984px;top:168px;width:570.384px;height:91.19999999999999px;background:#1A2B45;border-radius:9.600000000000001px"></div><div class="r" style="left:680.784px;top:199.20000000000002px;width:28.799999999999997px;height:28.799999999999997px;background:#1A2B45;border:1.6px solid #2DD4BF;border-radius:3.84px"></div><div class="t" style="left:733.584px;top:168px;width:464.784px;height:91.19999999999999px;font-size:20px;color:#F1F5F9;text-align:left;justify-content:center;"><span>벡터 차원, 인덱스 연산자, 임베딩 모델이 적혀 있다</span></div><div class="r" style="left:651.984px;top:283.20000000000005px;width:570.384px;height:91.19999999999999px;background:#1A2B45;border-radius:9.600000000000001px"></div><div class="r" style="left:680.784px;top:314.40000000000003px;width:28.799999999999997px;height:28.799999999999997px;background:#1A2B45;border:1.6px solid #2DD4BF;border-
<section class="slide"><h2 class="t" style="left:57.599999999999994px;top:43.2px;width:1164.768px;height:86.4px;font-size:42.666666666666664px;color:#F1F5F9;font-weight:700;text-align:left;justify-content:center;"><span>오늘 팀에서 할 일</span></h2><div class="t" style="left:57.599999999999994px;top:672px;width:576px;height:28.799999999999997px;font-size:13.333333333333334px;color:#A8B8CC;text-align:left;justify-content:center;"><span>최종 프로젝트 · DB 스키마 설계서 작성법</span></div><div class="t" style="left:1145.568px;top:672px;width:76.80000000000001px;height:28.799999999999997px;font-size:13.333333333333334px;color:#A8B8CC;text-align:right;justify-content:center;"><span>23</span></div><div class="t" style="left:57.599999999999994px;top:134.39999999999998px;width:1164.768px;height:43.2px;font-size:22.666666666666668px;color:#2DD4BF;text-align:left;justify-content:center;"><span>API 설계 문서를 옆에 펼쳐 놓고 시작한다</span></div><div class="r" style="left:57.599999999999994px;top:240px;width:260.952px;height:220.79999999999998px;background:#1A2B45;border-radius:9.600000000000001px"></div><div class="t" style="left:72px;top:268.79999999999995px;width:232.15200000000004px;height:48px;font-size:24px;color:#F1F5F9;font-weight:700;text-align:center;justify-content:center;"><span>① 테이블 목록</span></div><div class="t" style="left:72px;top:331.20000000000005px;width:232.15200000000004px;height:86.4px;font-size:18.666666666666668px;color:#CBD5E1;text-align:center;justify-content:flex-start;"><span>API 필드에서
저장할 대상 뽑기</span></div><div class="t" style="left:318.552px;top:240px;width:40.32px;height:220.79999999999998px;font-size:26.666666666666668px;color:#2DD4BF;text-align:center;justify-content:center;"><span>→</span></div><div class="r" style="left:358.872px;top:240px;width:260.952px;height:220.79999999999998px;background:#1A2B45;border-radius:9.600000000000001px"></div><div class="t" style="left:373.27200000000005px;top:268.79999999999995px;width:232.15200000000004px;height:48px;font-size:24px;color:#F1F5F9;font-weight:700;text-align:center;justify-content:center;"><span>② ERD와 관계 표</span></div><div class="t" style="left:373.27200000000005px;top:331.20000000000005px;width:232.15200000000004px;height:86.4px;font-size:18.666666666666668px;color:#CBD5E1;text-align:center;justify-content:flex-start;"><span>키 컬럼과
1:N 관계 그리기</span></div><div class="t" style="left:619.8240000000001px;top:240px;width:40.32px;height:220.79999999999998px;font-size:26.666666666666668px;color:#2DD4BF;text-align:center;justify-content:center;"><span>→</span></div><div class="r" style="left:660.144px;top:240px;width:260.952px;height:220.79999999999998px;background:#1A2B45;border-radius:9.600000000000001px"></div><div class="t" style="left:674.5440000000001px;top:268.79999999999995px;width:232.15200000000004px;height:48px;font-size:24px;color:#F1F5F9;font-weight:700;text-align:center;justify-content:center;"><span>③ 엔터티 정의</span></div><div class="t" style="left:674.5440000000001px;top:331.20000000000005px;width:232.15200000000004px;height:86.4px;font-size:18.666666666666668px;color:#CBD5E1;text-align:center;justify-content:flex-start;"><span>핵심 테이블의
SQL 실행까지</span></div><div class="t" style="left:921.0960000000001px;top:240px;width:40.32px;height:220.79999999999998px;font-size:26.666666666666668px;color:#2DD4BF;text-align:center;justify-content:center;"><span>→</span></div><div class="r" style="left:961.4160000000002px;top:240px;width:260.952px;height:220.79999999999998px;background:#0F766E;border-radius:9.600000000000001px"></div><div class="t" style="left:975.8160000000001px;top:268.79999999999995px;width:232.15200000000004px;height:48px;font-size:24px;color:#F1F5F9;font-weight:700;text-align:center;justify-content:center;"><span>④ RLS 표 초안</span></div><div class="t" style="left:975.8160000000001px;top:331.20000000000005px;width:232.15200000000004px;height:86.4px;font-size:18.666666666666668px;color:#F1F5F9;text-align:center;justify-content:flex-start;"><span>역할별 권한을
팀이 함께 정하기</span></div><div class="r" style="left:57.599999999999994px;top:513.5999999999999px;width:1164.768px;height:71.03999999999999px;background:#0A1322;border-radius:7.68px"></div><div class="t" style="left:86.39999999999999px;top:513.5999999999999px;width:1107.1680000000001px;height:71.03999999999999px;font-size:18.666666666666668px;color:#CBD5E1;text-align:left;justify-content:center;"><span>문서 머리말에 문서 버전과 작성 상태를 적는다. 예: 문서 버전 v0.1 | 작성 상태: 초안</span></div></section>
</main>
<div class="bar" id="bar"></div>
<script>
(function(){
var stage=document.querySelector('.stage'),slides=[].slice.call(document.querySelectorAll('.slide')),i=0,present=true,bar=document.getElementById('bar');
function fit(){
var s=present?Math.min(innerWidth/1280,innerHeight/720):Math.min(1,(innerWidth-32)/1280);
stage.style.transform='scale('+s+')';
stage.style.marginLeft=Math.max(0,(innerWidth-1280*s)/2)+'px';
stage.style.marginTop=present?Math.max(0,(innerHeight-720*s)/2)+'px':'16px';
stage.style.height=present?'720px':'';
}
function show(){
document.body.classList.toggle('present',present);
slides.forEach(function(el,k){el.classList.toggle('on',k===i)});
bar.textContent=present?(i+1)+' / '+slides.length+' · ←/→ 이동 · O 전체 보기 · F 전체 화면':'O 발표 보기 · 인쇄(Ctrl/⌘+P)로 PDF 저장';
fit(); if(!present) slides[i].scrollIntoView();
}
function go(d){i=Math.max(0,Math.min(slides.length-1,i+d));show()}
addEventListener('keydown',function(e){
if(['ArrowRight','PageDown',' ','Enter'].indexOf(e.key)>=0){e.preventDefault();go(1)}
else if(['ArrowLeft','PageUp','Backspace'].indexOf(e.key)>=0){e.preventDefault();go(-1)}
else if(e.key==='Home'){i=0;show()} else if(e.key==='End'){i=slides.length-1;show()}
else if(e.key==='o'||e.key==='O'){present=!present;show()}
else if(e.key==='f'||e.key==='F'){document.fullscreenElement?document.exitFullscreen():document.documentElement.requestFullscreen()}
});
stage.addEventListener('click',function(e){if(present)go(e.clientX<innerWidth/3?-1:1)});
addEventListener('resize',fit); show();
})();
</script>
</body></html>