stripe / pg-schema-diff

Go library for diffing Postgres schemas and generating SQL migrations
MIT License
278 stars 20 forks source link

Remove extraneous `NOT NULL` statement generation. Update README #89

Closed bplunkett-stripe closed 6 months ago

bplunkett-stripe commented 6 months ago

Description

Remove extraneous NOT NULL statement generation. If the parent table column is being altered from NULL -> NOT NULL (or vice versa), then we don't need to generate any SQL for the child table

Motivation

Simplify SQL generation. This also removes false positive ACCESS_EXCLUSIVE_LOCK migration hazards https://github.com/stripe/pg-schema-diff/issues/88

Testing

Acceptance tests