
CREATE TABLE public.association_faqs (
  id UUID PRIMARY KEY DEFAULT gen_random_uuid(),
  association_id UUID NOT NULL REFERENCES public.associations(id) ON DELETE CASCADE,
  question TEXT NOT NULL,
  answer TEXT,
  sort_order INT DEFAULT 0,
  created_at TIMESTAMPTZ NOT NULL DEFAULT now(),
  updated_at TIMESTAMPTZ NOT NULL DEFAULT now()
);

ALTER TABLE public.association_faqs ENABLE ROW LEVEL SECURITY;

CREATE POLICY "Authenticated users can view association FAQs"
  ON public.association_faqs FOR SELECT TO authenticated USING (true);

CREATE POLICY "Authenticated users can insert association FAQs"
  ON public.association_faqs FOR INSERT TO authenticated WITH CHECK (true);

CREATE POLICY "Authenticated users can update association FAQs"
  ON public.association_faqs FOR UPDATE TO authenticated USING (true) WITH CHECK (true);

CREATE POLICY "Authenticated users can delete association FAQs"
  ON public.association_faqs FOR DELETE TO authenticated USING (true);
