implmentace plan guardu
This commit is contained in:
18
db/migration/V052__plan_fatal_deviation_sent.sql
Normal file
18
db/migration/V052__plan_fatal_deviation_sent.sql
Normal file
@@ -0,0 +1,18 @@
|
||||
-- Jednorázové potvrzení odeslání fatálního Discord alertu plán vs. skutečnost (deduplikace po slotu).
|
||||
|
||||
create table ems.plan_fatal_deviation_sent (
|
||||
site_id int not null references ems.site (id),
|
||||
interval_start timestamptz not null,
|
||||
reason_code text not null,
|
||||
sent_at timestamptz not null default now(),
|
||||
primary key (site_id, interval_start)
|
||||
);
|
||||
|
||||
create index idx_plan_fatal_deviation_sent_sent_at
|
||||
on ems.plan_fatal_deviation_sent (sent_at desc);
|
||||
|
||||
comment on table ems.plan_fatal_deviation_sent is
|
||||
'Backend job po uzavření 15min slotu: při fatální odchylce grid plán vs. audit jednou pošle Discord a zapíše řádek (PK site_id + interval_start).';
|
||||
|
||||
comment on column ems.plan_fatal_deviation_sent.reason_code is
|
||||
'Kód z ems.fn_plan_actual_slot_guard_site (např. GRID_SIGN_MISMATCH, GRID_EXPORT_SPIKE).';
|
||||
Reference in New Issue
Block a user