Page MenuHomePhabricator

Work around an issue in MariaDB where dropping a column from a UNIQUE KEY fails
ClosedPublic

Authored by epriestley on Aug 30 2018, 1:18 PM.
Tags
None
Referenced Files
F19468218: D19624.diff
Sun, Jan 4, 12:33 AM
F18917617: D19624.id.diff
Nov 9 2025, 9:52 AM
F18865148: D19624.diff
Nov 3 2025, 10:48 AM
F18837040: D19624.id46910.diff
Oct 27 2025, 4:12 AM
F18837038: D19624.id46909.diff
Oct 27 2025, 4:11 AM
F18837037: D19624.id.diff
Oct 27 2025, 4:11 AM
F18833954: D19624.diff
Oct 26 2025, 6:48 AM
F18833714: D19624.id.diff
Oct 26 2025, 5:13 AM
Subscribers
Restricted Owners Package

Details

Summary

See T13193. See T13077. If we drop a column which is part of a UNIQUE KEY, MariaDB raises an error.

This is probably a bad idea on our side anyway, but in this case it wasn't an obviously bad idea.

To get around this:

  • Drop the unique key, if it exists, before dropping the column.
  • Explicitly add the new unique key afterward.
Test Plan

Ran bin/storage upgrade locally without issue, but I'm on MySQL. Will follow up on T13193.

Diff Detail

Repository
rP Phabricator
Lint
Lint Not Applicable
Unit
Tests Not Applicable