doc(sql-migrate): add PGOPTIONS multi-tenant schema docs to help text

Document how to use PGOPTIONS="-c search_path=..." for multi-tenant
PostgreSQL migrations. Each schema gets its own _migrations table,
so tenants are migrated independently.
This commit is contained in:
AJ ONeal 2026-04-08 15:06:41 -06:00
parent 2080ae223d
commit da7f45438c
No known key found for this signature in database

View File

@ -131,6 +131,14 @@ NOTES
The 'create' generates an up/down pair of files using the current date and
the number 1000. If either file exists, the number is incremented by 1000 and
tried again.
NOTE: POSTGRES SCHEMAS
Set PGOPTIONS to target a specific PostgreSQL schema:
PGOPTIONS="-c search_path=tenant123" sql-migrate up | sh
Each schema gets its own _migrations table, so tenants are migrated
independently. PGOPTIONS is supported by psql and all libpq clients.
`
var (