2
Laravel 3.x를 테스트하기위한 더미 사이트를 구축 중입니다.Laravel 마이그레이션 - 테이블 접두사 문제
지금 사이트 이전을 만들고 있습니다. 다음과 같은 오류가 나타나기까지 모든 것이 잘하고 있었다 :
SQLSTATE[42s02]: Base table or view not found: 1146 Table 'databasenamehere.prefix_laravel_migrations' doesn't exist
문제는 갑자기 시작 모두가 'laravel_migrations'테이블 접두사가 laravel입니다 (그것이 단지 다른 사람과 그것을 어떻게해야 할 때) .
제가 잘못했거나 알려진 문제인지 궁금합니다.
내가합니다 ( PHP 장인 마이그레이션 응용 프로그램 명령을 사용하여) 다음 마이그레이션을 실행하기 위해 노력하고있어 :public function up()
{
Schema::create('siteinfo', function ($table)
{
$table->engine = 'InnoDB';
$table->string('name');
$table->string('title')->nullable();
$table->string('corp_name')->nullable();
$table->string('corp_addr')->nullable();
$table->string('corp_phone')->nullable();
$table->string('corp_city')->nullable();
$table->string('corp_state')->nullable();
$table->string('corp_email')->nullable();
$table->string('main_url')->nullable();
$table->timestamps();
});
}
어떤 도움이 좋을 것.
편집 1 :
- 나는 심지어 설정/database.php 파일에 올바르게 설정 "접두사"구성으로, 몇 분 전 내 테이블이 전혀 접두사 없어 것으로 나타났습니다.
- 접두어를 제거하면 모든 것이 잘 작동합니다. 나는 다시 을이,
migrate:reset
를 설정 한 후'mysql' => array( 'driver' => 'mysql', 'host' => 'localhost', 'database' => 'foodb', 'username' => 'root', 'password' => '', 'charset' => 'utf8', 'prefix' => 'ula_', <-- this is where you need to set the table prefix ),
을 다음과
migrate
로application->config->database.php
에서
'application' ->'config' ->'database.php'에서'prefix'는 무엇입니까? – Simone
"ma_"로 테이블의 접두사를 붙였습니다. 그래서, "ma_laravel_migrations"테이블에 오류가 있다는 것은 당연히 존재하지 않습니다 ... – darksoulsong
Artisan이 사용할 마이그레이션 테이블을 설정하기 위해'php artisan migrate : install'을 실행 해 보셨습니까? – BenjaminRH