@recaptime-dev's working patches + fork for Phorge, a community fork of Phabricator. (Upstream dev and stable branches are at upstream/main and upstream/stable respectively.) hq.recaptime.dev/wiki/Phorge
phorge phabricator
at upstream/main 32 lines 728 B view raw
1<?php 2 3$conn = $schema_conn; 4 5$tables = queryfx_all( 6 $conn, 7 "SELECT TABLE_SCHEMA db, TABLE_NAME tbl 8 FROM information_schema.TABLES s 9 WHERE s.TABLE_SCHEMA LIKE %> 10 AND s.TABLE_NAME != 'search_documentfield' 11 AND s.ENGINE != 'InnoDB'", 12 '{$NAMESPACE}_'); 13 14if (!$tables) { 15 return; 16} 17 18echo pht( 19 "There are %d tables using the MyISAM engine. These will now be converted ". 20 "to InnoDB. This process may take a few minutes, please be patient.\n", 21 count($tables)); 22 23foreach ($tables as $table) { 24 $name = $table['db'].'.'.$table['tbl']; 25 echo pht('Converting %s...', $name)."\n"; 26 queryfx( 27 $conn, 28 'ALTER TABLE %T.%T ENGINE=InnoDB', 29 $table['db'], 30 $table['tbl']); 31} 32echo pht('Done!')."\n";