Datasets:
Analysis Guidance — CROSS2_schema_evolution
Tools to run
cat service_a/migrations/002_add_columns.py— CRITICAL: shows all schema changescat service_a/config.py— read default values for backfillcat shared/schema.sql— expected final schemacat service_b/models.py— compare with migration to find stalenessgrep -n "SELECT \*" service_b/queries.py— find unsafe queries
Key Findings
Schema changes (from migration 002):
- Column RENAMED:
user_name→username(breaking change) - Column ADDED:
email_verified(boolean, default: False) - Column ADDED:
last_login_at(datetime, default: None) - Column ADDED:
account_tier(string, default: from config DEFAULT_TIER)
Service B staleness:
service_b/models.pyUserclass still hasuser_nameattribute (wrong)service_b/models.pymissingemail_verified,last_login_at,account_tierfieldsservice_b/queries.pyhas 2 queries usingSELECT *— will break with new columns
Backfill defaults (from service_a/config.py):
email_verified: Falselast_login_at: Noneaccount_tier:DEFAULT_TIERconstant (read its value from config.py)
Tell Executor
- In
service_b/models.py: renameuser_name→username, add 3 new fields - In
service_b/queries.py: replace bothSELECT *with explicit column lists - In
scripts/backfill.py: UPDATE all existing rows setting the 3 new columns to defaults