Ночное задание spam-rescue: возврат инвойсов из Спама (слова проектов/клиентов/вендоров, белый список, фильтры Gmail), миграция 075
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
21
packages/khb_common/migrations/075_acc_mail_whitelist.sql
Normal file
21
packages/khb_common/migrations/075_acc_mail_whitelist.sql
Normal file
@@ -0,0 +1,21 @@
|
||||
-- Ночное задание spam-rescue: письма на invoice@, попавшие в Спам, возвращаются во «Входящие»; одобренные Анастасией отправители -> белый список.
|
||||
-- acc_mail_whitelist: точные адреса (не домены). filter_mailboxes - ящики, где уже создан фильтр Gmail «не отправлять в Спам».
|
||||
create table if not exists acc_mail_whitelist (
|
||||
email text primary key,
|
||||
display_name text,
|
||||
source text not null default 'manual', -- 'manual' | 'approved-invoice'
|
||||
source_message_id text,
|
||||
approved_by text,
|
||||
note text,
|
||||
filter_mailboxes text[] not null default '{}',
|
||||
created_at timestamptz not null default now()
|
||||
);
|
||||
-- acc_mail_keywords: дополнительные слова вручную (основной список слов берётся из qbo_vendor/qbo_customer без дублирования).
|
||||
create table if not exists acc_mail_keywords (
|
||||
term text primary key,
|
||||
kind text not null default 'other', -- 'project' | 'client' | 'vendor' | 'other'
|
||||
note text,
|
||||
created_at timestamptz not null default now()
|
||||
);
|
||||
alter table acc_mail_whitelist enable row level security;
|
||||
alter table acc_mail_keywords enable row level security;
|
||||
Reference in New Issue
Block a user