CREATE TABLE "message_templates" (
  "id" uuid PRIMARY KEY DEFAULT gen_random_uuid(),
  "name" text NOT NULL UNIQUE,
  "category" text NOT NULL,
  "status" text NOT NULL,
  "language" text NOT NULL,
  "header_text" text,
  "body_text" text NOT NULL,
  "footer_text" text,
  "buttons_json" jsonb,
  "created_at" timestamptz NOT NULL DEFAULT now(),
  "updated_at" timestamptz NOT NULL DEFAULT now()
);

CREATE INDEX "message_templates_status_category_language_idx"
  ON "message_templates" ("status", "category", "language");
