Ref T1191. Allow bin/storage adjust to modify columns.
- Although CREATE TABLE ... colname VARCHAR(64) CHARACTER SET BINARY works fine, it's actually a trick. Adjust the binary columns for this.
Differential D10598
Allow `bin/storage adjust` to correct column types and collations epriestley on Sep 28 2014, 1:00 PM. Authored by Tags None Referenced Files
Subscribers Tokens
Details
Ref T1191. Allow bin/storage adjust to modify columns.
See comment.
Diff Detail
Event TimelineComment Actions This can fix almost all issues, but we still have a handful of overlong keys and other minor issues. Here's where my local database stands after running this to completion once: >>> orbital ~/devtools/phabricator $ ./bin/storage adjust Verifying database schemata... Database Table Name Issues phabricator2_differential differential_diffproperty name Better Collation Available, Better Character Set Available phabricator2_file file_imagemacro name Better Collation Available, Better Character Set Available phabricator2_file file_transformedfile transform Better Collation Available, Better Character Set Available phabricator2_herald herald_rule name Better Collation Available, Better Character Set Available phabricator2_herald herald_transcript garbageCollected Better Collation Available, Better Character Set Available, Wrong Column Type phabricator2_meta_data patch_status patch Better Collation Available, Better Character Set Available phabricator2_metamta metamta_mailinglist name Better Collation Available, Better Character Set Available phabricator2_metamta metamta_mailinglist email Better Collation Available, Better Character Set Available phabricator2_owners owners_package name Better Collation Available, Better Character Set Available phabricator2_phame phame_blog domain Better Collation Available, Better Character Set Available phabricator2_phragment phragment_fragment path Better Collation Available, Better Character Set Available, Wrong Column Type phabricator2_phragment phragment_snapshot name Better Collation Available, Better Character Set Available, Wrong Column Type phabricator2_project project name Better Collation Available, Better Character Set Available phabricator2_project project phrictionSlug Better Collation Available, Better Character Set Available phabricator2_project project_slug slug Better Collation Available, Better Character Set Available phabricator2_releeph releeph_project name Better Collation Available, Better Character Set Available phabricator2_repository repository_arcanistproject name Better Collation Available, Better Character Set Available phabricator2_repository repository_badcommit fullCommitName Better Collation Available, Better Character Set Available phabricator2_repository repository_branch name Better Collation Available, Better Character Set Available Found 19 issues(s) with schemata, detailed above. You can review issues in more detail from the web interface, in Config > Database Status. MySQL needs to copy table data to make some adjustments, so these migrations may take some time. WARNING: This workflow is new and unstable. If you continue, you may unrecoverably destory data. Make sure you have a backup before you proceed. Fix these schema issues? [y/N] y Fixing schema issues... Done. Target Error phabricator2_differential.differential_diffproperty #1071: Specified key was too long; max key length is 767 bytes phabricator2_file.file_imagemacro #1071: Specified key was too long; max key length is 767 bytes phabricator2_file.file_transformedfile #1071: Specified key was too long; max key length is 767 bytes phabricator2_herald.herald_rule #1071: Specified key was too long; max key length is 767 bytes phabricator2_herald.herald_transcript #1064: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '<unknown> CHARACTER SET <unknown> COLLATE <unknown> NOT NULL' at line 1 phabricator2_meta_data.patch_status #1071: Specified key was too long; max key length is 767 bytes phabricator2_metamta.metamta_mailinglist #1071: Specified key was too long; max key length is 767 bytes phabricator2_metamta.metamta_mailinglist #1071: Specified key was too long; max key length is 767 bytes phabricator2_owners.owners_package #1071: Specified key was too long; max key length is 767 bytes phabricator2_phame.phame_blog #1071: Specified key was too long; max key length is 767 bytes phabricator2_phragment.phragment_fragment #1071: Specified key was too long; max key length is 767 bytes phabricator2_phragment.phragment_snapshot #1071: Specified key was too long; max key length is 767 bytes phabricator2_project.project #1071: Specified key was too long; max key length is 767 bytes phabricator2_project.project #1062: Duplicate entry 'ニニニ/' for key 'phrictionSlug' phabricator2_project.project_slug #1062: Duplicate entry 'ニニニ' for key 'key_slug' phabricator2_releeph.releeph_project #1071: Specified key was too long; max key length is 767 bytes phabricator2_repository.repository_arcanistproject #1071: Specified key was too long; max key length is 767 bytes phabricator2_repository.repository_badcommit #1071: Specified key was too long; max key length is 767 bytes phabricator2_repository.repository_branch #1071: Specified key was too long; max key length is 767 bytes Failed to make some schema adjustments, detailed above. Comment Actions Originally I planned to not handle column type changes here, but they're difficult to separate from collation changes and I think the "optional migrations which can fail individually" model is a better fit for them. Consequently, this fixes T6151, T6149, T6138, T6137, T6135, T6130, T6128, and T6105. |