세션 메모리와 비언어 이벤트 저장
This commit is contained in:
parent
e8e08935ed
commit
50fa4ad432
12 changed files with 2848 additions and 1277 deletions
|
|
@ -221,6 +221,7 @@ CREATE TABLE IF NOT EXISTS app.turns (
|
|||
silence_ms INT,
|
||||
speech_rate REAL,
|
||||
barge_in BOOLEAN,
|
||||
provider_events JSONB NOT NULL DEFAULT '[]'::jsonb,
|
||||
created_at TIMESTAMPTZ NOT NULL DEFAULT now(),
|
||||
UNIQUE (session_id, seq)
|
||||
);
|
||||
|
|
|
|||
|
|
@ -328,6 +328,31 @@ CREATE POLICY p_pinned_select ON app.pinned_fact FOR SELECT USING (
|
|||
AND current_setting('app.current_ai_view', true) = ANY(visible_to) )
|
||||
OR app.current_role_name() IN ('admin','instructor')
|
||||
);
|
||||
DROP POLICY IF EXISTS p_pinned_insert ON app.pinned_fact;
|
||||
CREATE POLICY p_pinned_insert ON app.pinned_fact FOR INSERT WITH CHECK (
|
||||
app.current_role_name() IN ('admin','instructor')
|
||||
OR EXISTS (
|
||||
SELECT 1 FROM app.case_profile cp
|
||||
WHERE cp.case_id = app.pinned_fact.case_id
|
||||
AND cp.learner_id = app.current_uid()
|
||||
)
|
||||
);
|
||||
DROP POLICY IF EXISTS p_pinned_update ON app.pinned_fact;
|
||||
CREATE POLICY p_pinned_update ON app.pinned_fact FOR UPDATE USING (
|
||||
app.current_role_name() IN ('admin','instructor')
|
||||
OR EXISTS (
|
||||
SELECT 1 FROM app.case_profile cp
|
||||
WHERE cp.case_id = app.pinned_fact.case_id
|
||||
AND cp.learner_id = app.current_uid()
|
||||
)
|
||||
) WITH CHECK (
|
||||
app.current_role_name() IN ('admin','instructor')
|
||||
OR EXISTS (
|
||||
SELECT 1 FROM app.case_profile cp
|
||||
WHERE cp.case_id = app.pinned_fact.case_id
|
||||
AND cp.learner_id = app.current_uid()
|
||||
)
|
||||
);
|
||||
|
||||
-- ── learner_profile: 학습자=본인, persistent_gaps 는 응답단 필터 ──
|
||||
ALTER TABLE app.learner_profile ENABLE ROW LEVEL SECURITY;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue