[英]Laravel 5.5 migration error
我正在嘗試遷移我的postgresql表,但是在啟動命令php artisan migrate
它會返回以下錯誤:
SQLSTATE [08P01]:<>:7錯誤:綁定消息提供1個參數,但准備好的語句“ pdo_stmt_00000003”需要2個參數(SQL:從information_schema.tables中選擇*,其中table_schema = migrations,table_name =?)
我的遷移之一:
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
class CreateSchedulesTable extends Migration {
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('schedules', function(Blueprint $table)
{
$table->increments('id');
$table->string('schedule_name')->unique();
$table->integer('parent_id')->unsigned()->nullable();
$table->integer('launch_sequence_id')->unsigned();
$table->string('day_of_week', 10)->nullable();
$table->string('command_type', 50);
$table->integer('hours')->unsigned()->nullable();
$table->integer('minutes')->unsigned()->nullable();
$table->integer('dd')->unsigned()->nullable();
$table->integer('mm')->unsigned()->nullable();
$table->integer('yyyy')->unsigned()->nullable();
$table->boolean('enabled')->default(1);
$table->boolean('ascending')->default(0);
$table->dateTime('last_execution')->nullable();
$table->dateTime('last_success')->nullable();
$table->integer('retry')->default(0);
$table->timestamps();
$table->softDeletes();
});
DB::statement('ALTER TABLE schedules ADD CONSTRAINT day_of_week_check CHECK ((day_of_week)::text = ANY (ARRAY[(\'all\'::character varying)::text, (\'monday\'::character varying)::text, (\'tuesday\'::character varying)::text, (\'wednesday\'::character varying)::text, (\'thursday\'::character varying)::text, (\'friday\'::character varying)::text, (\'saturday\'::character varying)::text, (\'sunday\'::character varying)::text]))');
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::drop('schedules');
}
}
而我的數據庫配置:
'default' => env('DB_CONNECTION', 'pgsql'),
'connections' => [
'pgsql' => [
'driver' => 'pgsql',
'host' => env('DB_HOST', '127.0.0.1'),
'port' => env('DB_PORT', '5432'),
'database' => env('DB_DATABASE', 'forge'),
'username' => env('DB_USERNAME', 'forge'),
'password' => env('DB_PASSWORD', ''),
'charset' => 'utf8',
'prefix' => '',
'schema' => env('DB_SCHEMA', 'public'),
//'sslmode' => 'prefer',
]
],
我的.env
DB_CONNECTION=pgsql
DB_HOST=127.0.0.1
DB_PORT=5432
DB_DATABASE=livion
DB_USERNAME=livion
DB_PASSWORD=secret
DB_SCHEMA=public
我試圖對其進行跟蹤,似乎它沒有為函數repositoryExists
使用正確的語法,它使用了默認的語法,而沒有發送schema參數。
通過模型或存儲庫執行的其他查詢工作正常,我僅對於遷移命令遇到此錯誤。
有解決這個問題的建議嗎?
我找出問題所在。 我將項目從laravel 5.3遷移到5.5,舊項目使用了模塊Aejnsn \\ Postgresify。
這導致我的遷移問題。
刪除它,然后所有工作再次。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.