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
F13269334: D19624.diff
Wed, May 29, 6:09 AM
F13258547: D19624.id.diff
Sun, May 26, 10:21 AM
F13255339: D19624.diff
Sat, May 25, 4:38 AM
F13234484: D19624.diff
Tue, May 21, 3:27 AM
F13228756: D19624.diff
Mon, May 20, 11:50 AM
F13226376: D19624.id46909.diff
Sun, May 19, 8:22 PM
F13213948: D19624.diff
Fri, May 17, 8:17 AM
F13207406: D19624.id46909.diff
Wed, May 15, 11:15 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