Commercial Lease Ledger Schema Migration Brief
Plan zero-downtime database schema migrations for commercial property lease accounting engines.
Use this template when upgrading legacy real estate property management databases to modernized transactional schemas. It establishes dual-write patterns, backfill safety, and rollback checkpoints.
Role: Staff Database Migration Engineer specializing in transactional financial ledgers and property asset management systems.
Context
- Legacy database system: {{source_erp_database}}
- Target schema architecture: {{target_schema_type}}
- Active lease volume: {{active_lease_records}}
- Maintenance window allowance: {{downtime_allowance_window}}
- Multi-currency/entity complexity: {{currency_multi_entity_scope}}
- Financial compliance framework: {{audit_compliance_standard}}
Task
Author a zero-downtime database migration brief outlining schema refactoring, dual-write synchronization, and data validation protocols for transferring historical and active commercial lease ledgers without interrupting billing cycles.
Method
- Map legacy relational dependencies in {{source_erp_database}} to the target schema entities in {{target_schema_type}}.
- Design an append-only ledger schema structure ensuring double-entry immutability under {{audit_compliance_standard}}.
- Construct an expand-and-contract migration phased plan respecting {{downtime_allowance_window}}.
- Formulate asynchronous trigger-based or change-data-capture dual-write mechanisms for real-time lease ledger replication.
- Establish automated reconciliation scripts to verify ledger balances across {{active_lease_records}} records.
- Address exchange rate historical lock-in requirements dictated by {{currency_multi_entity_scope}}.
- Define explicit rollback tripwires, lock timeout thresholds, and data consistency checkpoints.
Constraints
- MUST ensure schema designs preserve full financial auditability required by {{audit_compliance_standard}}.
- MUST NOT acquire long-lived exclusive table locks during migration execution.
- Migration cutover operations must fit strictly within {{downtime_allowance_window}}.
- Maintain absolute referential integrity across tenant, lease, and payment schedule tables.
Output format
Format the brief with the following distinct sections:
- Schema Transformation Matrix (tabular mapping of legacy entities to target tables)
- Multi-Phase Cutover Plan (ordered phases: Expand, Dual-Write, Backfill, Validate, Contract)
- Lock Contention Mitigation (specific DDL lock timeout and online indexing strategies)
- Validation & Reconciliation Protocol (automated SQL reconciliation queries and balance check logic)
- Rollback & Abort Thresholds (4 clear metrics for immediate rollback invocation)
Self-review
- Verify that zero-downtime techniques align with the time constraints of {{downtime_allowance_window}}.
- Ensure every compliance requirement from {{audit_compliance_standard}} is reflected in ledger audit tables.
- Check that the reconciliation protocol validates all active entities across {{active_lease_records}}.
Explicit role, a named task, and discrete steps the model can follow.
Background, inputs and variables the model needs before it starts.
Hard boundaries — what the model must and must not do.
A named, field-level shape for the response.
Ordered work items that force analysis before an answer.
Length and structure that travel across frontier models.
Signal density — instruction weight without padding.
Documented variables so the scaffold adapts to new inputs.
Quality bar, assumptions and behaviour when inputs are thin.
How much real usage the template has behind it.