Working with Data Source Schema Changes
Introduction
When you connect a data source to Wren AI, the schema of the data source is imported into Wren AI. The schema includes the tables, columns, and relationships of the data source. If the schema of the data source changes, Wren AI will detect the changes when you manually click the Refresh icon in the sidebar.
Detecting Schema Changes
When you click the Refresh icon, Wren AI will compare the current schema of the data models with the schema of the data source. If there are any changes, Wren AI will display a Warning Sign in the sidebar. Click the Warning Sign to view the detected changes.
Viewing Schema Changes
The Schema Changes page displays the detected changes in the schema of the data models. The changes are categorized into the following types:
Source table deleted
A table in the data source has been deleted. You could see which model is affected by the deletion.
If there are any relationships or calculated fields that depend on the deleted tables, you can see them in the collapsed section.
Source column deleted
A column in the data source has been deleted. You could see which model is affected by the deletion.
If there are any relationships or calculated fields that depend on the deleted columns, you can see them in the collapsed section.
Source column type changed
The data type of a column in the data source has been changed. You could see which model is affected by the change.
If there are any relationships or calculated fields that depend on the changed columns, you can see them in the collapsed section.
Resolving Schema Changes
To resolve the schema changes, you can click the Resolve button next to the detected changes. By clicking the Resolve button, Wren AI will automatically delete all affected models, relationships, and calculated fields.
After resolving the schema change, you'll see a Success notificaiton pop up.
For the source column type changed change, Wren AI doesn't provide an automatic resolution. You need to manually reselect the changed column by updating the data model (clicking Update Columns
on the models) and redefining the relationships and calculated fields if necessary.