0012_email_suppressions.sql 798 B

1234567891011121314151617181920
  1. -- email_suppressions — recipients we won't send to.
  2. -- Populated by the mittera webhook (permanent bounces, complaints,
  3. -- mittera-side suppressions) and by operator action via the admin UI.
  4. -- The outbound send path checks this table before posting to mittera.
  5. CREATE TABLE IF NOT EXISTS "email_suppressions" (
  6. "id" text PRIMARY KEY NOT NULL,
  7. "email" text NOT NULL,
  8. "reason" text NOT NULL,
  9. "detail" text,
  10. "source_event_id" text,
  11. "created_at" timestamp with time zone DEFAULT now() NOT NULL,
  12. CONSTRAINT "email_suppressions_email_unique" UNIQUE ("email")
  13. );
  14. CREATE INDEX IF NOT EXISTS "email_suppressions_email_idx"
  15. ON "email_suppressions" USING btree ("email");
  16. CREATE INDEX IF NOT EXISTS "email_suppressions_created_idx"
  17. ON "email_suppressions" USING btree ("created_at");