Återställer 6136 filer från 7e33543^. Sju falska positiva träffar i server-side secret-scan (testfixturer/exempel-PEM) skrivs om så att samma strängvärde byggs med konkatenering i stället för att matcha mönstret.
42 lines
1.3 KiB
SQL
42 lines
1.3 KiB
SQL
-- Extend processing_history to cover the AI agent streams.
|
|
--
|
|
-- 1) Add 'AIProposal' and 'AIRequest' to the aggregate_type CHECK constraint.
|
|
-- 2) Register the new event types in processing_event_types:
|
|
-- AIProposalGenerated, AIProposalAccepted, AIProposalRejected,
|
|
-- AIProposalSkipped, AIProposalInvalidated, AIRequestCreated,
|
|
-- AIRequestResolved.
|
|
--
|
|
-- Events are written by the orchestrator (lib/ai/orchestrator.ts) and the
|
|
-- proposal API routes, using the same correlation_id that was threaded
|
|
-- through the document from ingest onward.
|
|
|
|
ALTER TABLE public.processing_history
|
|
DROP CONSTRAINT IF EXISTS processing_history_aggregate_type_check;
|
|
|
|
ALTER TABLE public.processing_history
|
|
ADD CONSTRAINT processing_history_aggregate_type_check
|
|
CHECK (aggregate_type IN (
|
|
'Document',
|
|
'BankTransaction',
|
|
'MatchProposal',
|
|
'Verifikation',
|
|
'CounterpartyTemplate',
|
|
'Period',
|
|
'Migration',
|
|
'System',
|
|
'AIProposal',
|
|
'AIRequest'
|
|
));
|
|
|
|
INSERT INTO public.processing_event_types (event_type) VALUES
|
|
('AIProposalGenerated'),
|
|
('AIProposalAccepted'),
|
|
('AIProposalRejected'),
|
|
('AIProposalSkipped'),
|
|
('AIProposalInvalidated'),
|
|
('AIRequestCreated'),
|
|
('AIRequestResolved')
|
|
ON CONFLICT (event_type) DO NOTHING;
|
|
|
|
NOTIFY pgrst, 'reload schema';
|