Skip to main content

ERD 개요

개요

Lumie는 RLS(Row-Level Security) 기반 멀티테넌시를 사용합니다. V18(2026-05-12)에서 schema-per-tenant 전략을 완전 제거하고 단일 public 스키마로 통합했습니다. 모든 테넌트 스코프 테이블은 tenant_id BIGINT NOT NULL 컬럼과 FORCE ROW LEVEL SECURITY 정책으로 행 단위 격리합니다.

별도 물리 스키마(tenant_{slug}, billing)는 존재하지 않습니다. langgraph 스키마는 LangGraph 체크포인터 전용으로 존재하며 테넌트 데이터를 포함하지 않습니다.

스키마별 역할

영역테이블 범위RLS주요 테이블
플랫폼 공유cross-tenant없음tenants, owner_directory, federated_identities, tenant_settings
빌링cross-tenant없음plans, subscriptions, invoices, billing_keys, alimtalk_credits
테넌트 스코프per-tenant (RLS)있음학생/강사/수업/시험/출결/강의/AI/수납 등 모든 업무 데이터
langgraph체크포인터 전용없음checkpoints, checkpoint_blobs, checkpoint_writes

DB 역할

역할용도권한
lumie_app런타임 연결NOSUPERUSER NOBYPASSRLS — RLS 정책 항상 적용
postgresFlyway 마이그레이션SUPERUSER — RLS 우회 가능
lumie_langgraphLangGraph 체크포인터langgraph 스키마만 접근, public 스키마 접근 없음

핵심 마이그레이션 이력

버전변경
public V1tenants, tenant_settings 생성
public V4federated_identities 추가
public V9ENTERPRISE → MAX 리네임, custom_id 추가
public V13event_publication (Spring Modulith)
public V14shedlock
public V15타임스탬프 TIMESTAMPTZ 전환
public V18RLS baseline — schema-per-tenant 폐기, 모든 테넌트 테이블 public 통합 + RLS 일괄 적용
public V22owner_directory 신설
public V26adminsstaff / admin_permissionsstaff_permissions
public V27langgraph 스키마 신설
public V28플랫폼 빌링 테이블 (plans, subscriptions, invoices 등)
public V29학원 수납 테이블 (guardians, tuition_invoices 등)
public V37subscriptions 예약 변경 컬럼
public V38billing_operation_locks
public V49plans.custom_domains 제거
public V51ENTERPRISE → MAX (plans 시드)
public V52attendance_sessions 유니크 제약
public V53attendance_records 기본 상태 PENDING

상세 ERD