Page MenuHomePhabricator

Support key schemata and column nullability
ClosedPublic

Authored by epriestley on Sep 15 2014, 6:18 PM.

Details

Summary

Ref T1191. The major issue motivation here is that InnoDB keys have a maximum length of 767 bytes. When we move utf8 colums to utf8mb4 columns, they'll jump from 3 bytes per character to 4 bytes per character, which may make some indexes too long. Add key schema to help spot this.

Also add nullability since it doesn't hurt.

Test Plan

See screenshots.

Diff Detail

Repository
rP Phabricator
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

epriestley retitled this revision from to Support key schemata and column nullability.
epriestley updated this object.
epriestley edited the test plan for this revision. (Show Details)
epriestley added a reviewer: btrahan.
btrahan edited edge metadata.

You forgot the screenshots of testage. (NBD for me but if you have 'em handy maybe add 'em for completeness sake?)

src/applications/config/controller/PhabricatorConfigDatabaseController.php
408

767 ==> self::MAX_INNODB_KEY_LENGTH or something?

This revision is now accepted and ready to land.Sep 16 2014, 6:39 PM

Oh, derp. I think I just deleted them locally. Let me grab some fresh ones -- nothing too exciting, but they help fill in the picture.

Couple of screenshots:

Screen_Shot_2014-09-18_at_8.26.30_AM.png (1×1 px, 283 KB)

Notable part here is highlighting the too-long key, which makes it easier to spot this stuff before we commit to migrating any actual data. This helped identify T6098 / T6099 (and probably a bunch of others by the time all the schemata are set up).

Screen_Shot_2014-09-18_at_8.27.30_AM.png (1×1 px, 238 KB)

epriestley edited edge metadata.
  • Use a constant for the InnoDB magic number.
This revision was automatically updated to reflect the committed changes.