# Database Workflow Proposal: mr_rakesh_verification

This file contains the email draft proposal to Mr. Rakesh regarding the disciplined database migration workflow protocol for the 5 portals.

---

**Subject:** Proposed database workflow for your 5 portals — seeking your confirmation

Hi Mr. Rakesh,

I’m assisting Madhav in setting up a disciplined, industry-standard database workflow across his five portals (two static, three with databases: medical, Q&A/student, and accounts/admin). Based on your earlier messages, I’ve formulated the following protocol to guide him. Please confirm if this matches your expectations or if you’d like any adjustments.

### Protocol Outlined for Madhav:

1. **Baseline schema file (first step)**
   * For each database-backed portal, export the current database structure to `schema.sql` (via phpMyAdmin or equivalent).
   * Anonymize all sensitive data (patient details, student data, financial identifiers, etc.) before committing.
   * This becomes the reproducible foundation for any developer or environment.

2. **No ad hoc SQL**
   * Madhav will not run any SQL statements directly (manually or via AI).
   * Every database change must go through a migration file.

3. **Versioned migration files**
   * All schema/data changes will be saved as sequentially numbered SQL files: `migration-001.sql`, `migration-002.sql`, etc.
   * Each file describes exactly what changed and in what order.

4. **Git as the single source of truth**
   * All SQL files (`schema.sql` + `migration-*.sql`) will be committed to Git.
   * This ensures any developer can recreate the exact database state with anonymized test data, and environments can be upgraded safely and repeatably.

### Implementation plan:
* Start with the least sensitive portal to build confidence, then proceed to medical and accounts portals.
* For each portal: export → anonymize → organize into `db/schema.sql` + `db/migrations/` → commit to Git.
* Going forward, every change will be a new numbered migration, reviewed before application.

Could you please confirm whether this protocol aligns with what you had in mind? If anything needs to be tightened, reordered, or expanded, I’ll adjust Madhav’s workflow accordingly.

Best regards,  
**Madhav Joshi**  
*(Drafted by Assistant)*
