2) Input
This section defines the database change request that SchemaFlow will process. Think of it as the compact ticket, issue, or message a data team might receive before turning the request into implementation details.
The default request asks the workflow to:
- Add
LOYALTY_TIER VARCHAR(20)toODS.ODS_CUSTOMER_PROFILE. - Treat the new column as nullable.
- Backfill from
CORE.DIM_CUSTOMER. - Join on
CUSTOMER_ID. - Filter the source to current records with
IS_CURRENT=true. - Add a non-unique index on
(CUSTOMER_ID, LOYALTY_TIER).
This input is intentionally compact but rich enough to exercise the full workflow:
- parsing target schema and table
- extracting column name, type, and nullability
- recognizing backfill requirements
- recognizing index requirements
- generating multi-layer SQL
- running validation checks for expected table, column, and SQL actions
python
CHANGE_TEXT = """Add LOYALTY_TIER VARCHAR(20) to ODS.ODS_CUSTOMER_PROFILE as nullable.
Backfill from CORE.DIM_CUSTOMER on CUSTOMER_ID where IS_CURRENT=true.
Add a non-unique index on (CUSTOMER_ID, LOYALTY_TIER)."""
print(CHANGE_TEXT)