2017-03-11 3 views
1
public function up() { 
     $tableOptions = 'CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE=InnoDB'; 
     $columns = [ 
      'id' => $this->primaryKey(), 
      'name' => $this->string(255)->notNull(), 
      'price' => $this->decimal(10, 2)->notNull()->defaultValue(0), 
      'original_price' => $this->decimal(10, 2)->notNull()->defaultValue(0), 
      'special_price' => $this->decimal(10, 2)->notNull()->defaultValue(0), 
      'comment' => $this->string(10), 
      'is_deleted' => $this->boolean()->defaultValue(0), 
      'created_at' => $this->dateTime()->notNull(), 
      'updated_at' => $this->ti`enter code here`mestamp() 
     ]; 
     $this->createTable('tbl_ironing_order_item', $columns, $tableOptions); 
    } 

을 작동하지, 난 서버 마이그레이션에 프로젝트를 배포, 최근 마이그레이션은 어떤 오류가 표시되지 봉사에서 실행되지 새 모듈을 만들고, 어떻게 마이그레이션을 실행할 수 있습니다 배포시에?yii2/마이그레이션 난 프레임 워크를 yii2 사용하고

+2

당신은'PHP는 YII의 migrate'를 실행해야합니다. 파일은 강도 부여를위한 명명 규칙을 따라야 함을 기억하십시오. –

답변

1

마이그레이션 파일이 콘솔/마이그레이션 디렉토리에 있는지 확인하십시오. 그들이 그 디렉토리에 있지 경우에, 당신은 그들이있는 디렉토리를 지정할 수 있습니다.

실행

php yii migrate/up [email protected]/path/to/your/migrations