How Can I Track Schema Changes in My Destination?
Question
Where can I find a detailed log of all schema changes Fivetran has made in my destination?
Environment
- All connectors and destinations
- The Fivetran Platform Connector
Answer
The Fivetran Platform Connector captures all schema and table changes we make to your destination. To see what changed and when it occurred, query the LOG table for the following events:
create_schema: Schema created in the destinationcreate_table: Table created in the destinationdrop_table: Table dropped from the destinationalter_table: Table columns added to, modified in, or dropped from the destination table
For example, run the following query to track all schema changes:
SELECT
event,
message_data,
message_event,
time_stamp
FROM <destination_db>.<destination_schema>.log
WHERE message_event IN (
'create_schema',
'create_table',
'drop_table',
'alter_table'
)
ORDER BY time_stamp DESC;
Run the following query to track all table changes:
SELECT
event,
message_data,
message_event,
time_stamp
FROM <destination_db>.<destination_schema>.log
WHERE message_event IN (
'create_table',
'drop_table',
'alter_table'
)
ORDER BY time_stamp DESC;
To track future schema changes, create a view in your destination that tracks these events.
For setup instructions, see our Fivetran Platform Connector Setup Guide.