Add rename_constraint operation to PgRollOperation JSON schema definition (#300)

Otherwise migrations that include this operation are not valid according
to the JSON schema.

Fixup to https://github.com/xataio/pgroll/pull/293.
This commit is contained in:
Andrew Farries 2024-03-01 16:02:28 +00:00 committed by GitHub
parent 577870c325
commit eda936f158
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 29 additions and 0 deletions

View File

@ -0,0 +1,18 @@
This is a valid 'rename constraint' migration.
-- rename_constraint.json --
{
"name": "migration_name",
"operations": [
{
"rename_constraint": {
"table": "people",
"from": "name_length",
"to": "name_length_check"
}
}
]
}
-- valid --
true

View File

@ -468,6 +468,17 @@
},
"required": ["drop_constraint"]
},
{
"type": "object",
"description": "Rename constraint operation",
"additionalProperties": false,
"properties": {
"rename_constraint": {
"$ref": "#/$defs/OpRenameConstraint"
}
},
"required": ["rename_constraint"]
},
{
"type": "object",
"description": "Drop index operation",