-
Notifications
You must be signed in to change notification settings - Fork 159
Expand file tree
/
Copy pathdbdiff.yml.example
More file actions
140 lines (124 loc) · 5.84 KB
/
dbdiff.yml.example
File metadata and controls
140 lines (124 loc) · 5.84 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
# 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=<value>; 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:PASSWORD@aws-0-REGION.pooler.supabase.com: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:PASSWORD@aws-0-REGION.pooler.supabase.com: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:PASS@aws-0-us-east-1.pooler.supabase.com:5432/postgres \
# --server2-url postgres://postgres.XYZ:PASS@aws-0-us-east-1.pooler.supabase.com:5432/staging