Stage-0 usage measurement (VISION/ADR-016): summary_actions captures acts
(watch/skip/save) but not reads. A reader who logs in weekly and clicks
nothing is invisible — for a reading product that return is the signal the
gate ("usage in >=2 distinct weeks") is defined on. login_events records
THAT a user was active, append-only, one row per user per active day.
Per-user isolation via the same GUC-keyed FORCE RLS policy as migration 003.
No FK to users (mirrors summary_actions) — the cascade footgun is handled by
DeleteUser in a later commit. Adds an up/down reversibility test and registers
the table in both truncate helpers.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
5 lines
204 B
SQL
5 lines
204 B
SQL
DROP POLICY IF EXISTS login_events_isolation ON login_events;
|
|
ALTER TABLE login_events NO FORCE ROW LEVEL SECURITY;
|
|
ALTER TABLE login_events DISABLE ROW LEVEL SECURITY;
|
|
DROP TABLE IF EXISTS login_events;
|