Check for and resolve schema changes
Included in the basic Tonic API.
Before you start a data generation job, we recommend that you check for and resolve any schema changes on the source database.
From the API, you can:
- Retrieve a list of schema changes
- Resolve schema changes
In the results, each schema change uses the following format:
{
"schemaName": "string",
"tableName": "string",
"issueCode": "string",
"columnName": "string",
"oldDataType": "string",
"newDataType": "string"
}
Where:
schemaName | The name of the affected schema. |
tableName | The name of the affected table. For MongoDB, this is the name of the affected collection. |
issueCode | The type of schema change. Possible values are:
|
columnName | The name of the affected column. For new or removed tables or collections, there is no column name. |
oldDataType | For columns that change type, the previous data type. |
newDataType | For columns that change type, the new data type. |
You can use the API to resolve schema changes.
When you use the API to resolve schema changes:
- For non-conflicting schema changes (new tables and columns), Tonic does not make any changes to the configuration.
- For information on how Tonic resolves conflicting schema changes, see How Tonic resolves conflicting issues.
To resolve a single schema change, use POST /api/SchemaDiff/resolve. The request body provides the details for a single schema change.
To resolve multiple changes, use POST /api/SchemaDiff/resolve_multiple. The request body provides the details for each schema change.
In the request body, each schema change has the following format:
{
"workspaceId": "string",
"issueCode": "new_column",
"schemaName": "string",
"tableName": "string",
"columnName": "string",
"dataType": "string"
}
Where:
workspaceId | The identifier of the workspace. |
issueCode | The type of issue. |
schemaName | The name of the affected schema. |
tableName | The name of the affected table. |
columnName | The name of the affected column. Only provided for column-specific issues. |
dataType | For MongoDB only. The data type for the affected column. |
Last modified 1mo ago