mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
BUGFIX #2476: Rename lowercase tables to correct casing if they have been transferred from a windows box.
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@90548 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
parent
bd452e1579
commit
50831cba9a
@ -281,6 +281,11 @@ class MySQLDatabase extends SS_Database {
|
||||
*/
|
||||
public function checkAndRepairTable($tableName) {
|
||||
if(!$this->runTableCheckCommand("CHECK TABLE \"$tableName\"")) {
|
||||
if($this->runTableCheckCommand("CHECK TABLE \"".strtolower($tableName)."\"")){
|
||||
Database::alteration_message("Table $tableName: renamed from lowercase","repaired");
|
||||
return $this->renameTable(strtolower($tableName),$tableName);
|
||||
}
|
||||
|
||||
DB::alteration_message("Table $tableName: repaired","repaired");
|
||||
return $this->runTableCheckCommand("REPAIR TABLE \"$tableName\" USE_FRM");
|
||||
} else {
|
||||
|
Loading…
Reference in New Issue
Block a user