You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: server/scripts/capture_events_schema.sql
+5Lines changed: 5 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -153,10 +153,13 @@ CREATE INDEX IF NOT EXISTS events_data_gin_idx
153
153
154
154
COMMENT ON TABLE public.events IS
155
155
'CodeChat dissertation capture events. Course, group, assignment, condition, and task context are joined during analysis from participant/date mappings.';
156
+
COMMENT ON COLUMN public.events.event_id IS 'Opaque stable per-event ID for correlation and future deduplication; not used for event ordering.';
157
+
COMMENT ON COLUMN public.events.sequence_number IS 'Client-local event order within one VS Code extension session, useful for ordering and detecting gaps.';
156
158
COMMENT ON COLUMN public.events.user_id IS 'Pseudonymous participant UUID generated or supplied by the VS Code extension.';
157
159
COMMENT ON COLUMN public.events.session_id IS 'Capture session UUID emitted by the VS Code extension.';
158
160
COMMENT ON COLUMN public.events.file_hash IS 'SHA-256 hash of the local file path; raw local paths are not stored.';
159
161
COMMENT ON COLUMN public.events."timestamp" IS 'Server receive/record timestamp in UTC.';
162
+
COMMENT ON COLUMN public.events.client_tz_offset_min IS 'Client timezone offset in minutes, used with timestamp to derive local time of day without storing location or full timezone name.';
160
163
COMMENT ON COLUMN public.events.data IS 'Event-specific JSON payload. Known telemetry metadata lives in typed columns.';
161
164
162
165
-- Least-privilege deployment guidance:
@@ -165,11 +168,13 @@ COMMENT ON COLUMN public.events.data IS 'Event-specific JSON payload. Known tele
165
168
-- password/database/user names, a database administrator can grant only the
166
169
-- permissions needed for capture inserts:
167
170
--
171
+
-- ```sql
168
172
-- CREATE ROLE codechat_capture_writer LOGIN PASSWORD 'replace-with-secret';
169
173
-- GRANT CONNECT ON DATABASE codechat_capture TO codechat_capture_writer;
170
174
-- GRANT USAGE ON SCHEMA public TO codechat_capture_writer;
171
175
-- GRANT INSERT ON public.events TO codechat_capture_writer;
172
176
-- GRANT USAGE ON SEQUENCE public.events_id_seq TO codechat_capture_writer;
177
+
-- ```
173
178
--
174
179
-- Do not grant SELECT, UPDATE, DELETE, CREATE, or ownership privileges to the
0 commit comments