Skip to content

v0.8.0

Latest
Compare
Choose a tag to compare
@github-actions github-actions released this 10 Dec 08:28
· 33 commits to main since this release
12acbde

⚑ Highlights

  • πŸ”‘ Support for multi-column primary keys (#413, #426)
  • πŸ€Έβ€β™‚οΈ Support for multi-column UNIQUE, CHECK and FOREIGN KEY constraints (#487, #464, #471, #466, #459)
  • πŸ“‡ Support for more index types (#417, #442)
  • πŸ’§ Support dropping DEFAULT constraints on columns (#478)
  • ⚑ New CLI commands:
    • pgroll migrate: apply outstanding migrations to the target database (#465)
    • pgroll latest: display the most recent schema version in the target database or local migrations directory (#469)
    • pgroll pull: pull the migration history from a target database and dump it to disk. (#463)
  • 🚀 Performance benchmarks, see them here (#472, #412)

Read the full release notes on the pgroll.com blog

πŸ”΄ Breaking changes

The format of the drop_constraint operation has changed to remove the column field. Column names should no longer be specified when dropping a constraint. This means that migrations like this must be updated to remove the column field:

{
  "name": "23_drop_check_constraint",
  "operations": [
    {
      "drop_constraint": {
        "table": "posts",
        "column": "title",     <-- should be removed
        "name": "title_length",
        "column": "title",
        "up": "title",
        "down": "(SELECT CASE WHEN length(title) <= 3 THEN LPAD(title, 4, '-') ELSE title END)"
      }
    }
  ]
}

Changelog

  • 0992c8d Add --skip-validation flag to start command (#448)
  • 85e917c Add pgroll migrate subcommand (#465)
  • b6fff69 Add a .ledger file which is built by make examples (#445)
  • 9c9518b Add a drop_multicolumn_constraint operation (#487)
  • 5a49929 Add a healthcheck to the db service in docker-compose.yml (#452)
  • eaaabf9 Add a pgroll latest command (#469)
  • 30d131e Add a pgroll pull subcommand (#463)
  • 1f6f49b Add a sql2pgroll package to convert SQL to pgroll migrations (#502)
  • 481f1c6 Add a benchmark for read_schema (#472)
  • fd94011 Add a config.json file for docs website (#500)
  • 86e02c5 Add and use a table cleanup assertion function (#493)
  • b6f76c7 Add backfill benchmarks (#412)
  • 898bd84 Add enum column examples (#444)
  • 68578f2 Add missing group by (#456)
  • 12ae369 Add support for composite keys in create table statements (#413)
  • d231ee0 Add support for creating CHECK constraints with create_constraint (#464)
  • a9b2048 Add support for creating foreign key constraints using create_constraint (#471)
  • ac1dd85 Add support for creating unique indexes (#442)
  • 171f5a2 Allow adding a column to a table created in the same migration (#449)
  • c677bbe Allow adding an index to a table created in the same migration (#451)
  • 1650210 Allow adding indexes to columns created in the same migration (#454)
  • 929ea27 Always surround up and down clauses in parentheses (#481)
  • 3c7b74b Avoid running all CI steps twice (#433)
  • 860f5a9 Build static HTML page using the latest benchmark results (#467)
  • 06d651b Bump github.com/pterm/pterm from 0.12.69 to 0.12.79 (#424)
  • 43a6d97 Bump github.com/pterm/pterm from 0.12.79 to 0.12.80 (#501)
  • 74a6fb5 Bump github.com/stretchr/testify from 1.9.0 to 1.10.0 (#486)
  • 388d0b5 Bump github.com/testcontainers/testcontainers-go/modules/postgres from 0.33.0 to 0.34.0 (#422)
  • 4468211 Bump golang.org/x/tools from 0.21.1-0.20240508182429-e35e4ccd0d2d to 0.26.0 (#425)
  • 0e34f78 Bump golang.org/x/tools from 0.26.0 to 0.27.0 (#460)
  • 0a282a2 Change SQL fomatting tool to pgformatter (#477)
  • e02c4a2 Change type of Column.Nullable from *bool to bool (#496)
  • 491927c Change type of Column.Pk from *bool to bool (#495)
  • d1daf8f Change type of Column.Unique from *bool to bool (#497)
  • 9626c20 Configure dependabot (#421)
  • 06bfebd Convert ALTER TABLE foo ADD CONSTRAINT bar UNIQUE (a) SQL to pgroll operation (#507)
  • 3512f76 Convert ALTER TABLE foo RENAME TO bar SQL to pgroll operation (#513)
  • 84661eb Convert DROP NOT NULL SQL to pgroll operation (#505)
  • d94d3b4 Convert RENAME COLUMN to pgroll operation (#511)
  • 34b623f Convert RENAME CONSTRAINT SQL to pgroll operation (#514)
  • c756988 Convert SET DATA TYPE SQL to pgroll operation (#506)
  • 7849864 Defer close of migration file (#430)
  • 96e50f9 Don't add series for missing row count (#474)
  • 5d63a7f Duplicate unique and check constraints correctly (#466)
  • 6ff198b Expand operation reference docs (#516)
  • f628060 Explicitly add Postgres 17 checks before merge into main (#415)
  • 88cc975 Extract initialisation SQL into separate file (#435)
  • 0b08a1d Fix read_schema function for multi-column foreign key constaints (#476)
  • eef4a9b Fix ledger file in examples folder (#447)
  • 8469bad Fix some command short descriptions (#470)
  • 6d48386 Handle scan and close errors in SchemaHistory (#482)
  • db74779 List enum types when reading schema (#443)
  • 5b7980d Make ALTER TABLE foo ALTER COLUMN a SET DATA TYPE text options unrepresentable (#508)
  • 2f637c3 Make check-ledger job required for release (#517)
  • 01ff6ac Move pkg/testutils and pkg/jsonschema into internal (#418)
  • b03cef2 Move validation testcases for op_create_constraint to a separate test (#494)
  • 7130506 New command: bootstrap (#414)
  • a5fb72e New operation: create_constraint and support unique constraints with multiple columns (#459)
  • e044c56 Persist benchmark results in CI (#461)
  • 7c01085 Quote schema when running ReadSchema (#419)
  • 06e69c2 Refactor docs (#510)
  • 999a299 Remove Column field from DropConstraint (#431)
  • 358c6c6 Remove pgroll sql subcommand (#515)
  • f85bca4 Remove unused operation names (#503)
  • a7f3e3c Remove unused parameter (#483)
  • 3b8c56e Rename and move test variables relating to sql2pgroll (#512)
  • 813b0a1 Respect context cancellation when backing off (#437)
  • ddd44bb Respect context deadline during batch backfill (#438)
  • 12acbde Run the build workflow on tag push (#520)
  • 7bc6eb8 Small cleanups (#484)
  • 1279b7d Small docs change to thecreate_constraint operation (#488)
  • fdebf23 Split docs/README.md into multiple files (#499)
  • e2f1740 Support creating different index types (#417)
  • 81dd0a7 Support dropping default for a column (#478)
  • b02c324 Support multiple PKs during backfilling (#426)
  • c35070a Tweak Makefile (#436)
  • 2d2b4a0 Up not required when adding serial columns (#432)
  • 434cf36 Update docs with deprecation notice (#498)
  • 416fb7a Update schema during add column validation (#457)
  • d656387 Update schema during create table validation (#455)
  • 0d3e17d Update tutorial with new sections (#509)
  • 7655f53 Use ubuntu 24.04 as the runner in all workflows (#518)
  • 515dd54 Use filepath.Glob in bootstrap (#416)
  • 0b5646d Validate check name is unique (#429)
  • 37a7232 Validate maximum identifier length (#439)
  • 9922e5f Validate that FK constraint name is unique (#428)
  • d00dd1e Validate that unique constraint name is unique (#427)
  • 4f484fc deps: Upgrade cobra and viper (#420)