Page MenuHomePhabricator

Allow `bin/storage adjust` to correct column types and collations
ClosedPublic

Authored by epriestley on Sep 28 2014, 1:00 PM.
Tags
None
Referenced Files
Unknown Object (File)
Thu, Apr 18, 11:00 AM
Unknown Object (File)
Wed, Apr 17, 8:01 PM
Unknown Object (File)
Wed, Apr 17, 12:10 AM
Unknown Object (File)
Fri, Apr 12, 10:36 AM
Unknown Object (File)
Thu, Apr 11, 8:49 AM
Unknown Object (File)
Mon, Apr 8, 1:42 PM
Unknown Object (File)
Mon, Apr 8, 1:24 PM
Unknown Object (File)
Mon, Apr 8, 10:32 AM
Subscribers
Tokens
"Mountain of Wealth" token, awarded by chad.

Diff Detail

Repository
rP Phabricator
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

epriestley retitled this revision from to Allow `bin/storage adjust` to correct column types and collations.
epriestley updated this object.
epriestley edited the test plan for this revision. (Show Details)
epriestley added a reviewer: btrahan.

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.
  • Minor change to query construction.
btrahan edited edge metadata.
This revision is now accepted and ready to land.Sep 30 2014, 5:00 PM
This revision was automatically updated to reflect the committed changes.