2016-03-08 171 views
0
SQLSTATE[42000]: Syntax error or access violation: 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 'by `batch` asc, `migration` asc' at line 1 (SQL: select `migration` from `migrations` orders by `batch` asc, `migration` asc) 

我正在使用Laravel 5.1,我之前刪除了Sequel pro中的所有表。我正在使用MySQL。問題是我每次運行PHP artisan migrate進行全新安裝時都會收到此錯誤。我已經刪除了對我的各種服務提供商的引用,並且我也沒有成功地將我的整個路由文件註釋掉了。在遷移表中只有一個遷移。Laravel遷移失敗

class CreateUsersTable extends Migration 
{ 
    /** 
    * Run the migrations. 
    * 
    * @return void 
    */ 
    public function up() 
    { 
     Schema::create('users', function (Blueprint $table) { 
      $table->increments('id'); 
      $table->string('name'); 
      $table->string('username'); 
      $table->string('email')->unique(); 
      $table->string('password', 60); 
      $table->string('avatar'); 
      $table->boolean('is_admin')->default(false); 
      $table->rememberToken(); 
      $table->timestamps(); 
     }); 
    } 

    /** 
    * Reverse the migrations. 
    * 
    * @return void 
    */ 
    public function down() 
    { 
     Schema::drop('users'); 
    } 

這是遷移我似乎無法得到持續,我已經試過作曲家自卸自動加載,PHP工匠遷移安裝我有試圖找出如何進一步解決此問題。有沒有人有任何想法?

回答

0

SQL是不正確的順序是:

orders by -> order by 
+0

OK我已刪除從遷移和順序orderscontroller和訂單表模型,每次我嘗試遷移我收到相同的錯誤。 – ormrepo

0

您sql中通過有錯誤訂單:

select `migration` from `migrations` orders by `batch` asc, `migration` asc