ci(schema-diff): Add script to generate diff of database schema (#2924)
The script should be given a base branch to compare against, if not set
it defaults to main. The script will apply the schema migrations for
both the base branch and the current commit and generate dumps that are
then compared to create a diff. The dumps are left in a temporary
directory so that they can be compared using a users preferred diff tool.
For example, generate the dumps and diff against main
./scripts/schema-diff.sh main
Examine the diff to database functions using delta:
delta .schema-diff/funcs_$(git rev-parse main) .schema-diff/funcs_$(git rev-parse HEAD)
This also adds a github action that runs the script on pull-requests
that contain schema changes and reports the diffs as a comment on the
pull-request.
Co-authored-by: Hugo Vieira <hugoamvieira@users.noreply.github.com>
This commit is contained in:
1 parent
21e73e4b17
commit
b00d888387
4 files changed
+299
No files matched your search
@@ -143,3 +143,5 @@ enos/ci/*/.terraform.lock.hcl
|
||||
!.release/ci.hcl
|
||||
dist
|
||||
out
|
||||
|
||||
.schema-diff/
|
||||
Reference in new issue
Block a user