회기 연속성과 멀티 케이스 계약을 영속화
This commit is contained in:
parent
be08c0b573
commit
72353ecd82
26 changed files with 2170 additions and 127 deletions
32
infra/db/init/20_public_bootstrap_ticket_events.sql
Normal file
32
infra/db/init/20_public_bootstrap_ticket_events.sql
Normal file
|
|
@ -0,0 +1,32 @@
|
|||
-- 공개 부트스트랩 장애의 재시도 이력을 support_ticket 본문과 분리해 append-only로 보존한다.
|
||||
-- 브라우저가 보낼 수 있는 값은 API의 폐쇄 enum으로 더 제한하므로 이 테이블에는
|
||||
-- 응답 원문, URL, 쿠키, 계정 식별자 같은 고객 데이터가 들어가지 않는다.
|
||||
|
||||
CREATE TABLE IF NOT EXISTS app.support_ticket_event (
|
||||
id BIGINT GENERATED ALWAYS AS IDENTITY PRIMARY KEY,
|
||||
ticket_id UUID NOT NULL
|
||||
REFERENCES app.support_ticket(id) ON DELETE CASCADE,
|
||||
observer_kind TEXT NOT NULL CHECK (observer_kind = 'public_browser'),
|
||||
event_kind TEXT NOT NULL CHECK (
|
||||
event_kind IN ('auth_restore_failure', 'boot_render_failure')
|
||||
),
|
||||
status_code SMALLINT NOT NULL CHECK (status_code IN (500, 502, 503, 504)),
|
||||
attempt TEXT NOT NULL CHECK (attempt IN ('automatic', 'retry')),
|
||||
source_path TEXT NOT NULL CHECK (source_path = '/ops/public-bootstrap'),
|
||||
created_at TIMESTAMPTZ NOT NULL DEFAULT now()
|
||||
);
|
||||
|
||||
CREATE INDEX IF NOT EXISTS idx_support_ticket_event_ticket_latest
|
||||
ON app.support_ticket_event(ticket_id, created_at DESC);
|
||||
|
||||
ALTER TABLE app.support_ticket_event ENABLE ROW LEVEL SECURITY;
|
||||
|
||||
DROP POLICY IF EXISTS p_support_ticket_event_select ON app.support_ticket_event;
|
||||
CREATE POLICY p_support_ticket_event_select
|
||||
ON app.support_ticket_event FOR SELECT
|
||||
USING (app.current_role_name() = 'admin');
|
||||
|
||||
DROP POLICY IF EXISTS p_support_ticket_event_insert ON app.support_ticket_event;
|
||||
CREATE POLICY p_support_ticket_event_insert
|
||||
ON app.support_ticket_event FOR INSERT
|
||||
WITH CHECK (app.current_role_name() = 'admin');
|
||||
Loading…
Add table
Add a link
Reference in a new issue