2016-03-15 133 views

回答

0

hostgator的問題是mysql的版本。他們使用舊版本,並在「information_schema」中顯示延遲。 我的解決方案是評論「information_schema」女巫的整個呼籲是不理想的,但工程。

此文件的路徑爲:{}程序my_app /vendor/cakephp/cakephp/src/Database/Schema/MysqlSchema.php

public function describeForeignKeySql($tableName, $config) 
{ 
    /* Commented by hsoberon to fix the delay in HOSTGATOR */ 
    // $sql = 'SELECT * FROM information_schema.key_column_usage AS kcu 
    //  INNER JOIN information_schema.referential_constraints AS rc 
    //  ON (
    //   kcu.CONSTRAINT_NAME = rc.CONSTRAINT_NAME 
    //   AND kcu.CONSTRAINT_SCHEMA = rc.CONSTRAINT_SCHEMA 
    // ) 
    //  WHERE kcu.TABLE_SCHEMA = ? AND kcu.TABLE_NAME = ? AND rc.TABLE_NAME = ?'; 

    // return [$sql, [$config['database'], $tableName, $tableName]]; 
} 

這樣的延遲是固定和一切都已經工作好。至今。