Schema Changes

Schema change detection for monitoring database structural drift

Monitors can track structural changes to your database schemas, alerting you when tables, columns, or types are added, dropped, or altered.

monitor-notification

Schema Change Detection

Schema change detection captures the full column-level state of your database on each monitor run and compares it against the previous state. Any differences — new tables, dropped columns, type changes — are recorded as events.

Configuration

Enable schema change detection with the schemata block:

Key
Type
Default
Description

enabled

bool

false

Enable schema change detection

exclude

string[]

["*.*_tmp"]

Glob patterns for objects to exclude from schema tracking

circle-exclamation

Exclude Patterns

Use exclude to skip objects that change frequently or are not relevant:

circle-info

When exclude is not set, the default pattern ["*.*_tmp"] excludes temporary tables automatically. Set exclude: [] (empty array) to disable all exclusions.

Detected Events

Event
Description

schema_added

A new schema was detected

schema_dropped

A schema was removed

table_added

A new table or view was detected

table_dropped

A table or view was removed

table_recreated

A table was dropped and re-created

column_added

A new column was added to an existing table

column_dropped

A column was removed from an existing table

column_type_altered

A column's data type was changed

Each event includes the database name, schema name, object name, and object type. For column_type_altered events, both the old and new data types are recorded.

Example

Monitor all tables in multiple schemas for structural changes:

Notifications

Enable On Schema Change in your monitor job's notification settings to receive alerts when schema drift is detected.

Last updated

Was this helpful?