See More

# dbdiff.yml — DBDiff configuration # # This single file configures both the diff command and the migration runner. # Copy it to dbdiff.yml in your project root and fill in your values. # # Auto-detected filenames (in priority order): # .dbdiff ← legacy plain-text YAML (no extension, no syntax highlighting) # dbdiff.yml ← recommended going forwards # .dbdiff.yml # dbdiff.yaml # # Command-line flags always override values in this file. # ───────────────────────────────────────────────────────────────────────────── # ── Diff command ────────────────────────────────────────────────────────────── # Used by: ./dbdiff server1.db:server2.db # server1 / server2 can be the same host — just specify two database names. server1: user: user password: password port: 3306 # MySQL: 3306 | PostgreSQL: 5432 host: 127.0.0.1 server2: user: user password: password port: 3306 host: 127.0.0.1 driver: mysql # mysql | pgsql | sqlite type: schema # schema | data | all include: up # up | down | both nocomments: false format: native # native | flyway | liquibase-xml | liquibase-yaml | laravel # ── Filtering ───────────────────────────────────────────────────────────────── # All list values support glob patterns: * (any chars), ? (single char). # Include list — only diff these tables. Omit to diff all tables. # tables: # - users # - orders # - wp_* # Exclude list — skip these tables entirely. # tablesToIgnore: # - _dbdiff_migrations # - cache_* # Exclude from data diff only — schema is still compared. # tablesDataToIgnore: # - audit_log # - event_stream # Per-table column exclusion (keys support globs). # fieldsToIgnore: # users: # - updated_at # - last_login # wp_*: # - ID # Per-table row filtering — skip rows matching a column-value regex. # rowsToIgnore: # wp_options: # - { column: option_name, pattern: "_transient_.*" } # - { column: option_name, pattern: "_site_transient_.*" } # sessions: # - { column: status, pattern: "expired|archived" } # Per-table scope override: schema, data, or all (default). # tableScope: # audit_log: schema # config: data # ── PHP memory limit ────────────────────────────────────────────────────────── # The CLI entry point (dbdiff / dbdiff.php / PHAR) sets a default of 1G, which # is sufficient for most databases. Raise it here if you're diffing very large # schemas or data sets, or lower it in resource-constrained environments. # Accepts any PHP shorthand: 512M, 1G, 2G, -1 (unlimited), etc. # Override on the fly with --memory-limit=; the CLI flag always wins. memory_limit: 1G # ── Database connection ─────────────────────────────────────────────────────── # Used by: dbdiff migration:up / migration:down / migration:status # Typically this points to one database (the target you are migrating). database: driver: mysql # mysql | pgsql | sqlite host: 127.0.0.1 port: 3306 name: mydb # For SQLite, use `path` instead: # path: ./database.sqlite user: root password: secret # sslmode: require # Needed for Supabase / production Postgres # ── Migrations ──────────────────────────────────────────────────────────────── migrations: dir: ./migrations # Where migration files are stored history_table: _dbdiff_migrations # Tracking table (created automatically) out_of_order: false # Allow applying older versions after newer ones format: native # native | supabase # native — {version}_{desc}.up.sql + optional .down.sql # supabase — {version}_{desc}.sql (UP-only) # Auto-set to 'supabase' when supabase/config.toml is detected # ── Supabase (Postgres) ─────────────────────────────────────────────────────── # Option A — paste a connection string directly (simplest): # # database: # url: postgres://postgres.PROJREF:[email protected]:5432/postgres # # The `url` key overrides individual host/user/password/port values. # SSL is automatically enabled when a Supabase hostname is detected. # # Option B — session-mode connection pooler (port 6543, pgbouncer): # # database: # url: postgres://postgres.PROJREF:[email protected]:6543/postgres # # pgbouncer mode is auto-enabled on port 6543 (sets PDO emulate_prepares = true). # # Option C — explicit fields (equivalent to Option A without URL parsing): # # database: # driver: pgsql # host: db.PROJREF.supabase.co # port: 5432 # name: postgres # user: postgres # password: your-db-password # sslmode: require # # Diff against two Supabase projects on the command line (no config file needed): # # dbdiff diff \ # --server1-url postgres://postgres.ABC:[email protected]:5432/postgres \ # --server2-url postgres://postgres.XYZ:[email protected]:5432/staging