Files
gongxue-base/supabase/migrations/202606300008_public_bank_sync_failure_notifications.sql
2026-06-30 09:12:45 +08:00

15 lines
589 B
SQL

alter table public.tenant_content_notifications
drop constraint if exists tenant_content_notifications_notification_type_check;
alter table public.tenant_content_notifications
add constraint tenant_content_notifications_notification_type_check
check (notification_type in (
'public_question_bank_synced',
'public_question_bank_conflict',
'public_question_bank_sync_failed'
));
create index if not exists idx_tenant_question_bank_adoptions_sync_ops
on public.tenant_question_bank_adoptions(sync_status, updated_at desc)
where sync_status in ('pending', 'failed');