Skip to content

Make Oban table creation configurable to use custom schema (avoid public schema pollution) #3251

@ElemTran

Description

@ElemTran

Problem

PR #3167 introduced Oban into Logflare (merged on 2026-03-02), and currently Oban creates its tables in the public database schema by default. This causes unnecessary schema pollution of the public namespace, which is undesirable for database organization and isolation of Logflare's analytics-related tables.

Expected Solution

Allow configuring the database schema for Oban tables via environment variables and/or direct config, with the intended target schema being _analytics for Logflare's analytics workloads.

  1. Set the Oban prefix to _analytics by default for Logflare: config :logflare, Oban, prefix: "_analytics"
  2. Add environment variable support for flexible schema control:
    • Primary: LOGFLARE_OBAN_SCHEMA (takes precedence if set)
    • Fallback: Reuse existing DB_SCHEMA if LOGFLARE_OBAN_SCHEMA is not provided

Thank you for considering this configuration improvement!

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions