2014-11-08 2 views
2

OctoberCMS가이 테이블을 생성 할 때 ID 열만 있습니다.Laravel artisan이 모든 열을 생성하지 않음

이유를 알 수 없습니다.

다음은 내 업데이트/createTable.php 파일의 클래스입니다. 이 같은

class CreateCellphoneTable extends Migration 
{ 

    public function up() 
    { 
    Schema::create('iaff106_cell_phones', function($table) 
    { 
     $table->engine = 'InnoDB'; 
     $table->increments('id'); 
     $table->integer('user_id')->unsigned()->nullable()->index(); 
     $table->string('label')->nullable(); 
     $table->string('phone')->index(); 
     $table->integer('provider_id')->nullable(); 
     $table->boolean('cantxt')->default(true); 
     $table->boolean('published')->default(false); 
     $table->timestamps(); 
    }); 
    } 
} 

내가 실행하고 장인 :

php artisan plugin:refresh IAFF106.CellPhone 
+0

생성 된 열은 무엇이며 어떤 것이 있습니까? – mwafi

답변

0

나는 그것의 내 코드입니다

당신이 여기

을 필요로하는 모든 클래스를 가져온 모든 필드를 생성하여 코드를 테스트 한 createTable.php

<?php namespace IAFF106\CellPhone\Updates; 
use Schema; 
use October\Rain\Database\Updates\Migration; 
class CreateCellphoneTable extends Migration 
{ 

    public function up() 
    { 
     Schema::create('iaff106_cell_phones', function($table) 
     { 
      $table->engine = 'InnoDB'; 
      $table->increments('id'); 
      $table->integer('user_id')->unsigned()->nullable()->index(); 
      $table->string('label')->nullable(); 
      $table->string('phone')->index(); 
      $table->integer('provider_id')->nullable(); 
      $table->boolean('cantxt')->default(true); 
      $table->boolean('published')->default(false); 
      $table->timestamps(); 
     }); 
    } 
} 
version.yaml에서

코드 내가 당신을

0

은 장인이 같은 문제를보고 매우 좋지 않은 것으로 밝혀 version.yaml 파일에 createTable.php을 지정할 수있는 희망

1.0.1: 
     - First version of CellPhone 
     - createTable.php 

enter image description here

입니다 예를 들어 철자가 틀린 PHP 파일.

내 version.yaml 파일에서 createTable.php 파일의 철자가 잘못되었습니다. Artisan은 불평을하지 않았지만 아무 것도하지 않았습니다.

anand patel의 답변과 새로운 모습으로 되돌아 오는 나를 결합하면이 사실을 알게되었습니다.

+0

version.yaml에서 데이터베이스 마이그레이션 파일로 첫 번째 행을 지정한 경우 첫 번째 행은 버전 주석을위한 것이며 이후 숙련 된 command.http : //octobercms.com/docs/plugin/registration#migrations-version-history의 영향은 없습니다. –

관련 문제