mirror of
https://github.com/xataio/pgroll.git
synced 2024-08-16 01:00:47 +03:00
PostgreSQL zero-downtime migrations made easy
Allow columns with `CHECK` constraints in `add_column` operations: ```json { "name": "26_add_column_with_check_constraint", "operations": [ { "add_column": { "table": "people", "column": { "name": "age", "type": "integer", "default": "18", "check": { "name": "age_check", "constraint": "age >= 18" } } } } ] } ``` |
||
---|---|---|
.github | ||
.vscode | ||
cmd | ||
examples | ||
pkg | ||
.golangci.yml | ||
docker-compose.yml | ||
go.mod | ||
go.sum | ||
main.go | ||
README.md |
pg-roll
⚠️ Under development ⚠️
PostgreSQL zero-downtime migrations made easy.
Getting started (development)
-
Bring a development PostgreSQL up:
docker compose up
-
Initialize pg-roll (first time only):
go run . init
-
Start a migration:
go run . start examples/01_create_tables.json
-
Inspect the results:
psql postgres://localhost -U postgres
\d+ public.* \d+ 01_create_tables.*
-
(Optional) Rollback the migration (undo):
go run . rollback
-
Complete the migration:
go run . complete