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
F21839839: D19624.diff
Wed, Aug 12, 5:41 PM
Unknown Object (File)
Jun 22 2026, 10:18 AM
Unknown Object (File)
Jun 22 2026, 10:12 AM
Unknown Object (File)
Jun 12 2026, 12:53 AM
Unknown Object (File)
Jun 6 2026, 1:07 PM
Unknown Object (File)
Apr 20 2026, 2:53 PM
Unknown Object (File)
Mar 28 2026, 2:58 PM
Unknown Object (File)
Feb 20 2026, 10:32 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