← back to Lawyer Directory Builder

migrations/009_site_mockups.sql

15 lines

-- One row per (firm, variant) — stores the path of the rendered mockup PNG
-- and the variant label/template id. Variants A/B/C are deterministic templates.

CREATE TABLE IF NOT EXISTS site_mockups (
  id              BIGSERIAL PRIMARY KEY,
  organization_id BIGINT NOT NULL REFERENCES organizations(id) ON DELETE CASCADE,
  variant         TEXT   NOT NULL,            -- 'a' | 'b' | 'c'
  template_label  TEXT   NOT NULL,            -- 'Editorial Noir', 'Clean Modern Light', 'Bold Confident'
  screenshot_path TEXT   NOT NULL,            -- /mockups/firm-{id}-{variant}.png
  generated_at    TIMESTAMPTZ NOT NULL DEFAULT NOW(),
  UNIQUE (organization_id, variant)
);

CREATE INDEX IF NOT EXISTS idx_site_mockups_org ON site_mockups (organization_id);