mirror of
https://github.com/xataio/pgroll.git
synced 2024-10-26 05:46:27 +03:00
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:
parent
577870c325
commit
eda936f158
18
pkg/jsonschema/testdata/rename-constraint-1.txtar
vendored
Normal file
18
pkg/jsonschema/testdata/rename-constraint-1.txtar
vendored
Normal 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
|
11
schema.json
11
schema.json
@ -468,6 +468,17 @@
|
|||||||
},
|
},
|
||||||
"required": ["drop_constraint"]
|
"required": ["drop_constraint"]
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"type": "object",
|
||||||
|
"description": "Rename constraint operation",
|
||||||
|
"additionalProperties": false,
|
||||||
|
"properties": {
|
||||||
|
"rename_constraint": {
|
||||||
|
"$ref": "#/$defs/OpRenameConstraint"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"required": ["rename_constraint"]
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"type": "object",
|
"type": "object",
|
||||||
"description": "Drop index operation",
|
"description": "Drop index operation",
|
||||||
|
Loading…
Reference in New Issue
Block a user