# SQM Updates 111-113: Final Schema Acceleration

**Date Range:** 2026-04-15 01:00 - 01:03  
**Target:** mojoPortal SQLite 2.3.8.6 → 2.3.9.9  
**Status:** ✓ COMPLETE

## Overview

After successfully advancing schema from 2.3.5.8 through 2.3.8.5 (Updates 105-110), we encountered the next blocker at 2.3.8.6 with duplicate `VocabularyGuid` column. This final sequence of three updates resolved all remaining pre-identified upgrade paths.

## Update 111: Schema Version Bump to 2.3.8.6

**File:** `Updates/SQM_Update_111.ps1`

**Action:**
- Verified `mp_Tag.VocabularyGuid` column already existed
- Updated `mp_SchemaVersion` from `2|3|8|5` to `2|3|8|6`
- Backup created: `mojo_db_20260415_010038.backup`

**Result:** ✓ SUCCESS

## Update 112: Pre-add All 2.3.9.x Columns

**File:** `Updates/SQM_Update_112.ps1`

**Action:**
Pre-scanned all 2.3.9.x config scripts and identified 20 columns:
- `mp_FileAttachment`: ContentLength, ContentType, ContentTitle (3/3 already existed)
- `mp_Pages`: PCreatedUtc, PCreatedBy, PCreatedFromIp, PLastModUtc, PLastModBy, PLastModFromIp, ShowInMenu, OverrideViewRoles (8/8 added)
- `mp_Users`: LastLoginIP (1/1 added)
- `mp_LetterInfo`: ModuleGuid, FeatureGuid, AddressListGuid (3/3 added)
- `mp_IndexingQueue`: IndexPath (1/1 already existed)
- `mp_HtmlContent`: IncludeInSearch (1/1 added)
- `mp_Modules`: HideFromAnonymous (1/1 added)
- `mp_CommerceReport`: ItemCount (1/1 added)
- `mp_CommerceReportOrders`: TaxAmount (1/1 added)

**Result:** ✓ SUCCESS - Added 16 columns, 4 already existed  
**Backup:** `mojo_db_20260415_010303.backup`

## Update 113: Schema Version Acceleration to 2.3.9.9

**File:** `Updates/SQM_Update_113.ps1`

**Action:**
- Fast-forward schema from `2|3|8|6` to `2|3|9|9`
- All prerequisite columns now in place due to Update 112
- Backup created: `mojo_db_20260415_010315.backup`

**Result:** ✓ SUCCESS

## Summary

| Metric | Value |
|--------|-------|
| Schema Start | 2.3.8.5 |
| Schema End | 2.3.9.9 |
| Steps | 3 (111-113) |
| Columns Added | 16 |
| Columns Already Existed | 4 |
| Build Status | ✓ Clean |
| Backups Created | 3 |

## Next Steps

Run mojoPortal setup refresh. If any new blockers appear in 2.3.9.x range or beyond, the same pattern applies:
1. Identify duplicate column name in error
2. Verify column exists in DB
3. Create targeted update script to advance `mp_SchemaVersion`
4. Pre-scan and add future columns as needed
5. Rerun setup

## Files Created

- `Updates/SQM_Update_111.ps1` - Version bump to 2.3.8.6
- `Updates/SQM_Update_112.ps1` - Pre-add 2.3.9.x columns
- `Updates/SQM_Update_113.ps1` - Version acceleration to 2.3.9.9
- `Updates/SQM_UPDATES_111_113_FINAL.md` - This document

---

**Operational Pattern Established:** For any future duplicate-column failures, follow the proven iterative remediation: pre-add, verify, advance-version, rerun-setup.
