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
F18715255: D19624.id.diff
Mon, Sep 29, 9:45 AM
F18644463: D19624.diff
Fri, Sep 19, 5:23 AM
F18568253: D19624.id46910.diff
Tue, Sep 9, 11:58 PM
F18568249: D19624.id46909.diff
Tue, Sep 9, 11:58 PM
F18509789: D19624.id.diff
Fri, Sep 5, 3:36 AM
F18503241: D19624.diff
Thu, Sep 4, 10:56 PM
F18078837: D19624.id46909.diff
Aug 4 2025, 8:28 PM
Unknown Object (File)
Jun 30 2025, 10:21 PM
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