> ## Documentation Index
> Fetch the complete documentation index at: https://docs.zwiron.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Schema Evolution

> How Zwiron detects source schema changes and controls how adds, renames, and drops apply to destinations.

Production databases change. Columns get added, renamed, or dropped. **Schema Evolution** is Zwiron's system for detecting these changes and giving you control over how they are applied to the destination.

***

## How it works

Every time a pipeline runs, Zwiron compares the current source schema (columns and types) to the schema it last saw. If anything changed, it creates a **Schema Proposal** — a record of exactly what changed and whether it's safe to apply automatically.

You review and act on proposals from the job detail page → **Schema** tab.

***

## Types of changes

| Change type     | Description                          | Auto-safe?                                      |
| --------------- | ------------------------------------ | ----------------------------------------------- |
| `add_column`    | A new column appeared at the source  | ✅ Yes — adds the column at the destination      |
| `drop_column`   | A column was removed from the source | ⚠️ No — needs your review                       |
| `modify_column` | A column's type changed              | ⚠️ Depends — widening is safe, narrowing is not |

***

## Safe vs. unsafe changes

### Safe (auto-applicable)

Zwiron can apply these automatically without risk of data loss:

* Adding a new column
* Widening a column type (e.g. `int32` → `int64`, `varchar(50)` → `varchar(255)`)

### Unsafe (require your review)

These require a human decision because they can cause data loss or breaks:

* **Dropping a column** — the destination keeps the column with NULLs, or you can approve dropping it
* **Narrowing a type** — e.g. `int64` → `int32` may truncate values
* **Modifying a primary key column** — could break upsert logic

***

## Proposal statuses

| Status           | Meaning                                                             |
| ---------------- | ------------------------------------------------------------------- |
| **Pending**      | Change detected, waiting for your review                            |
| **Applied**      | You approved — change was applied to the destination                |
| **Rejected**     | You rejected — change is ignored, pipeline continues as-is          |
| **Resynced**     | You triggered a full re-sync for this table after the schema change |
| **Auto-applied** | Zwiron applied the change automatically (safe changes only)         |

***

## Reviewing a proposal

1. Go to **Jobs** → select a job
2. Click the **Schema** tab
3. Review the pending proposal — you'll see the old schema, the new schema, and each specific change
4. Choose an action:
   * **Apply** — alter the destination table and resume syncing with the new schema
   * **Reject** — ignore the change and continue syncing with the old schema
   * **Re-sync** — drop and reload the full table with the new schema

***

## Automatic application

By default, Zwiron auto-applies **safe changes** (new columns, widening) immediately without creating a pending proposal. You'll see these in the proposal list with status `auto_applied`.

Unsafe changes always require manual review.

***

## Notifications

When a schema proposal is created and needs your review, Zwiron sends a notification. Configure where these go in [Notifications](/platform/notifications) — in-app or email today (`schema_pending_review`). Webhook delivery for this event is coming soon.

When a safe change is auto-applied, you receive a `schema_auto_applied` notification.

***

## Schema evolution and transforms

If you have column renames or drops configured in [Transforms](/concepts/transforms), those are applied to the incoming schema before comparison. A column you've already dropped via a transform won't generate a proposal even if it changes at the source.
