CREATE TABLE IF NOT EXISTS relation_insights ( id uuid PRIMARY KEY DEFAULT gen_random_uuid(), user_id uuid NOT NULL REFERENCES users(id), profile_a_id uuid NOT NULL REFERENCES profiles(id), profile_b_id uuid NOT NULL REFERENCES profiles(id), summary jsonb NOT NULL DEFAULT '{}', report_id uuid NULL REFERENCES growth_reports(id), created_at timestamptz NOT NULL DEFAULT now(), updated_at timestamptz NOT NULL DEFAULT now(), deleted_at timestamptz NULL ); CREATE INDEX IF NOT EXISTS idx_relation_insights_user_id ON relation_insights(user_id); CREATE INDEX IF NOT EXISTS idx_relation_insights_profiles ON relation_insights(profile_a_id, profile_b_id);