Open
Description
Installed the package into Laravel 12, and getting this error:
Too few arguments to function Illuminate\Database\Grammar::__construct(), 0 passed in /var/www/api/vendor/brokenice/laravel-mysql-partition/src/Schema/Schema.php on line 249 and exactly 1 expected,
here's my migration file:
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Brokenice\LaravelMysqlPartition\Models\Partition;
use Brokenice\LaravelMysqlPartition\Schema\Schema;
return new class extends Migration
{
/**
* Run the migrations.
*/
public function up(): void
{
Schema::create('partitions', function (Blueprint $table) {
$table->bigInteger('id');
$table->string('name');
$table->date('date');
$table->timestamps();
$table->primary(['id','date']);
});
Schema::forceAutoIncrement('partitions', 'id');
Schema::partitionByList('partitions', 'id',
[
new Partition('server_east', Partition::LIST_TYPE, [1,43,65,12,56,73]),
new Partition('server_west', Partition::LIST_TYPE, [534,6422,196,956,22])
]
);
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::dropIfExists('partitions');
}
};
Metadata
Metadata
Assignees
Labels
No labels