fix(sql): purge stranded legacy remote-storage columns (MySQL 8 safe) #210

Merged
jmiller merged 2 commits from fix/purge-legacy-remote-columns into main 2026-07-05 00:02:30 +00:00
Owner

Problem

02.52.25.sql used DROP COLUMN IF EXISTS — a MariaDB-only extension that errors on Oracle MySQL 8.x. On MySQL 8 installs that migration failed, but Joomla still recorded the schema as applied, so the 26 legacy remote_storage/ftp_*/sftp_*/gdrive_*/s3_* columns were left stranded on the profiles table and will never be retried.

Confirmed on suite.dev: MySQL 8.0.41, all 26 columns still present, 0 profiles with legacy remote data.

Fix

New 02.56.01.sql migration removes them portably and idempotently:

  • Gates on INFORMATION_SCHEMA.COLUMNS (presence of remote_storage, which tracks the whole set).
  • Builds an ALTER … DROP COLUMN … (plain drop — valid on both MySQL 8 and MariaDB) via a prepared statement, executed only when the columns exist; otherwise a DO 0 no-op.
  • So it's safe on stuck installs (drops), already-migrated installs (no-op), and fresh installs (columns never existed).

Assimilation into #__mokosuitebackup_remotes was intentionally omitted — no install has legacy remote data (the single-remote UI was removed back in 02.55.00), so there's nothing to migrate; the rows would be empty.

Validation

Ran non-destructively against suite.dev (build + PREPARE the ALTER, then DEALLOCATE without executing): gate returned 1, the ALTER prepared cleanly on MySQL 8.0.41 — nothing was dropped.

Note

suite.dev's schema is recorded at 02.52.29; this file (> 02.52.29) will run on the next extension update. If the schema-update chain is itself stuck there, the columns can also be dropped by running this ALTER directly — say the word and I'll apply it to suite.dev.

## Problem `02.52.25.sql` used `DROP COLUMN IF EXISTS` — a **MariaDB-only** extension that errors on **Oracle MySQL 8.x**. On MySQL 8 installs that migration failed, but Joomla still recorded the schema as applied, so the **26 legacy `remote_storage`/`ftp_*`/`sftp_*`/`gdrive_*`/`s3_*` columns were left stranded** on the profiles table and will never be retried. Confirmed on suite.dev: **MySQL 8.0.41**, all 26 columns still present, **0 profiles with legacy remote data**. ## Fix New `02.56.01.sql` migration removes them **portably and idempotently**: - Gates on `INFORMATION_SCHEMA.COLUMNS` (presence of `remote_storage`, which tracks the whole set). - Builds an `ALTER … DROP COLUMN …` (plain drop — valid on **both** MySQL 8 and MariaDB) via a **prepared statement**, executed only when the columns exist; otherwise a `DO 0` no-op. - So it's safe on stuck installs (drops), already-migrated installs (no-op), and fresh installs (columns never existed). Assimilation into `#__mokosuitebackup_remotes` was intentionally omitted — no install has legacy remote data (the single-remote UI was removed back in 02.55.00), so there's nothing to migrate; the rows would be empty. ## Validation Ran non-destructively against suite.dev (build + `PREPARE` the ALTER, then `DEALLOCATE` **without executing**): gate returned `1`, the ALTER prepared cleanly on MySQL 8.0.41 — nothing was dropped. ## Note suite.dev's schema is recorded at `02.52.29`; this file (`> 02.52.29`) will run on the next extension update. If the schema-update chain is itself stuck there, the columns can also be dropped by running this ALTER directly — say the word and I'll apply it to suite.dev.
jmiller added 1 commit 2026-07-05 00:02:10 +00:00
fix(sql): purge stranded legacy remote-storage columns (MySQL 8 safe)
Universal: PR Check / Branch Policy (pull_request) Successful in 2s
Joomla: Extension CI / Release Readiness Check (pull_request) Failing after 8s
Universal: PR Check / Secret Scan (pull_request) Successful in 9s
Universal: Pre-Release / Build Pre-Release (${{ inputs.stability || github.ref_name }}) (push) Successful in 34s
Universal: PR Check / Validate PR (pull_request) Failing after 15s
Generic: Repo Health / Site Health (pull_request) Has been skipped
Generic: Repo Health / Access control (pull_request) Successful in 2s
Joomla: Metadata Validation / Validate Joomla Metadata (pull_request) Successful in 15s
Universal: Build & Release / Promote to RC (pull_request) Failing after 17s
Universal: Build & Release / Build & Release Pipeline (pull_request) Has been skipped
Generic: Project CI / Lint & Validate (pull_request) Successful in 1m2s
Joomla: Extension CI / Lint & Validate (pull_request) Failing after 1m6s
Generic: Project CI / Tests (pull_request) Has been cancelled
Joomla: Extension CI / Tests (PHP 8.2) (pull_request) Has been cancelled
Joomla: Extension CI / Tests (PHP 8.3) (pull_request) Has been cancelled
Joomla: Extension CI / PHPStan Analysis (pull_request) Has been cancelled
Joomla: Extension CI / Build RC Pre-Release (pull_request) Has been cancelled
Universal: PR Check / Build RC Package (pull_request) Has been cancelled
Universal: PR Check / Report Issues (pull_request) Has been cancelled
Generic: Repo Health / Scripts governance (pull_request) Has been cancelled
Generic: Repo Health / Repository health (pull_request) Has been cancelled
Generic: Repo Health / Report: Scripts Governance (pull_request) Has been cancelled
Generic: Repo Health / Report: Repository Health (pull_request) Has been cancelled
6a62868881
02.52.25.sql used `DROP COLUMN IF EXISTS` (MariaDB-only), which errors on
Oracle MySQL 8.x — so on MySQL 8 installs the 26 legacy remote_storage/ftp_*/
sftp_*/gdrive_*/s3_* columns were never dropped, yet Joomla recorded the schema
as applied (confirmed on suite.dev: MySQL 8.0.41, all 26 columns still present,
0 profiles with legacy remote data).

New 02.56.01 migration removes them portably: an INFORMATION_SCHEMA-gated
prepared-statement ALTER that drops all 26 columns where present (plain
DROP COLUMN, valid on MySQL 8 + MariaDB) and is a no-op where already gone
(so it's safe on already-migrated installs too). Validated non-destructively
against suite.dev (gate=1, ALTER PREPAREs cleanly).

Claude-Session: https://claude.ai/code/session_01WbGBN9VyRK61zczYWcCQ2i
jmiller added 1 commit 2026-07-05 00:02:17 +00:00
chore(version): pre-release bump to 02.56.05-dev [skip ci]
RC Revert / Rename rc/ back to dev/ (pull_request) Has been skipped
Branch Cleanup / Delete merged branch (pull_request) Successful in 3s
Universal: Build & Release / Promote to RC (pull_request) Has been skipped
Universal: Build & Release / Build & Release Pipeline (pull_request) Successful in 44s
Universal: Workflow Sync Trigger / Sync workflows to live repos (pull_request) Successful in 9m41s
c7a57116a7
jmiller merged commit 2a7fb74ef9 into main 2026-07-05 00:02:30 +00:00
jmiller deleted branch fix/purge-legacy-remote-columns 2026-07-05 00:02:35 +00:00
Sign in to join this conversation.