Skip to content

Illuminate\Database\Grammar error in Laravel 12 #22

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
sts-ryan-holton opened this issue May 15, 2025 · 0 comments
Open

Illuminate\Database\Grammar error in Laravel 12 #22

sts-ryan-holton opened this issue May 15, 2025 · 0 comments

Comments

@sts-ryan-holton
Copy link

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');
    }
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant