PostgreSQL zero-downtime migrations made easy
Go to file
Andrew Farries 947b239b05
Allow columns with CHECK constraints on add column operations (#109)
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"
          }
        }
      }
    }
  ]
}
```
2023-09-20 09:52:22 +01:00
.github Stop disabling build cache in the examples job (#98) 2023-09-14 11:05:32 +01:00
.vscode Add linter to tests (#9) 2023-06-27 16:33:50 +01:00
cmd Add raw SQL operation (#43) 2023-08-30 11:50:59 +02:00
examples Allow columns with CHECK constraints on add column operations (#109) 2023-09-20 09:52:22 +01:00
pkg Allow columns with CHECK constraints on add column operations (#109) 2023-09-20 09:52:22 +01:00
.golangci.yml Add linter to tests (#9) 2023-06-27 16:33:50 +01:00
docker-compose.yml Initial commit 2023-06-22 17:30:40 +02:00
go.mod Change module name (#60) 2023-08-22 09:27:58 +01:00
go.sum Upgrade to Go 1 21 (#54) 2023-08-17 07:43:41 +01:00
main.go Change module name (#60) 2023-08-22 09:27:58 +01:00
README.md Add migrations state handling (#7) 2023-06-28 11:10:03 +02:00

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