wiki.techinc.nl/docs/abstract-schema-changes.schema.json
Gergő Tisza ef338f3d56
db: Allow describing table creation via abstract schema change
Allow the 'before' field of an abstract schema change to be empty,
to describe a schema change that adds a new schema.

Merge the SQL logic, as generateSchemaChangeSql.php did not have
any cleanup for CREATE commands. Make some replacements simpler
and/or more robust. There are some other minor functional changes:
some double spaces are replaced by single spaces, ALTER is
formatted more nicely.

Change-Id: Ib2f60b492ced8ffe7bd6119f590c81f6a0ea9282
2023-10-10 20:06:53 -07:00

31 lines
689 B
JSON

{
"$schema": "https://json-schema.org/schema#",
"description": "MediaWiki abstract database schema schema",
"type": "object",
"additionalProperties": false,
"properties": {
"comment": {
"type": "string",
"description": "Comment describing the schema change"
},
"before": {
"oneOf": [
{
"type": "object",
"description": "Emtpy object signifying table creation",
"maxProperties": 0
},
{
"type": "object",
"description": "Schema before the change",
"$ref": "abstract-schema-table.json"
}
]
},
"after": {
"type": "object",
"description": "Schema after the change",
"$ref": "abstract-schema-table.json"
}
}
}