mirror of
https://github.com/therootcompany/golib.git
synced 2026-04-24 12:48:00 +00:00
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:
parent
2080ae223d
commit
da7f45438c
@ -131,6 +131,14 @@ NOTES
|
|||||||
The 'create' generates an up/down pair of files using the current date and
|
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
|
the number 1000. If either file exists, the number is incremented by 1000 and
|
||||||
tried again.
|
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 (
|
var (
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user