pgroll/examples/36_set_comment_to_null.json
Andrew Farries 4f0a715613
Support setting table and column comments to NULL (#345)
Build on #344 to allow removing column comments by setting them to
`null`.

Make use of https://github.com/omissis/go-jsonschema/pull/220 and use
the [nullable](https://github.com/oapi-codegen/nullable) package so that
it's possible to distingush between a missing `comment` field and one
that is explicitly set to `null`.

With https://github.com/omissis/go-jsonschema/pull/220 not being part of
a release yet, use a custom build of `go-jsonschema`. It should be
possible to switch back to the official release images once
https://github.com/omissis/go-jsonschema/pull/220 is part of a release.

Without this change it becomes impossible to remove a comment from a
column using the 'set comment' 'alter column' sub-operation
(https://github.com/xataio/pgroll/pull/344).
2024-04-29 13:23:29 +01:00

15 lines
247 B
JSON

{
"name": "36_set_comment_to_null",
"operations": [
{
"alter_column": {
"table": "events",
"column": "event_name",
"comment": null,
"up": "event_name",
"down": "event_name"
}
}
]
}