mirror of
https://github.com/ZTatman/Nadir.git
synced 2026-11-20 20:08:00 +00:00
- Align NEW_PLAN.md db.py example to use @lru_cache(maxsize=1) for both get_supabase() and get_embedding_model(), matching actual implementation - Add missing imports (datetime, HTTPException, get_supabase) to check_ai_limit code example in NEW_PLAN.md - Add migration to auto-update entry_analysis.updated_at on row modification via a BEFORE UPDATE trigger Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
13 lines
367 B
PL/PgSQL
13 lines
367 B
PL/PgSQL
-- Auto-update entry_analysis.updated_at whenever a row is modified.
|
|
|
|
create or replace function public.set_updated_at()
|
|
returns trigger as $$
|
|
begin
|
|
new.updated_at = now();
|
|
return new;
|
|
end;
|
|
$$ language plpgsql;
|
|
|
|
create trigger trg_entry_analysis_updated_at
|
|
before update on public.entry_analysis
|
|
for each row execute function public.set_updated_at();
|