singlestore-labs / singlestoredb-laravel-driver

The official SingleStore Laravel driver.
https://github.com/singlestore-labs/singlestore-laravel-driver
Apache License 2.0
223 stars 22 forks source link

Redundant primary keys #76

Closed AmirHossein closed 8 months ago

AmirHossein commented 8 months ago

I can see that version 1.5.2 generates 2 primary keys for sample migration below:

Schema::create('table_name', function (Blueprint $table) {
    $table->string('name');
    $table->unsignedBigInteger('valu');

    $table->primary('name');
});

Sql is:

create table `table_name` (
    `name` varchar(255) not null,
    `val` bigint unsigned not null,
    primary key `table_name_name_primary`(`name`),
    primary key (`name`)
) default character set utf8mb4 collate 'utf8mb4_unicode_ci'

which throws SQL error like below: General error: 1851 COLUMNAR indexes and SKIPLIST indexes cannot be used on the same table

I would appreciate it if you could check it.

AmirHossein commented 8 months ago

It seems the package misses this update from a recent PR.

AdalbertMemSQL commented 8 months ago

Hey @AmirHossein You are right. I'm going to work on a fix.