Skip to content

operator class for GiST-index required (PostgreSQL) #278

@bleedchf

Description

@bleedchf
CREATE TABLE public.payers_subscriptions (
    id integer NOT NULL,
    client_internet inet
);

CREATE INDEX payers_subscriptions_client_internet_idx ON public.payers_subscriptions USING gist (client_internet inet_ops);

php artisan migrate:generate --ignore=users,cache,jobs,cache_locks,failed_jobs,job_batches,password_reset_tokens,sessions

Using connection: pgsql

Generating migrations for: payers_subscriptions

Do you want to log these migrations in the migrations table? (yes/no) [yes]:

Next Batch Number is: 2. We recommend using Batch Number 0 so that it becomes the "first" migration. [Default: 0] [0]:

Setting up Tables and Index migrations.
Created: /.../.../.../database/migrations/2025_07_09_013525_create_payers_subscriptions_table.php

Setting up Views migrations.

Setting up Stored Procedures migrations.

Setting up Foreign Key migrations.

Finished!


php artisan migrate:refresh

INFO Rolling back migrations.

0001_01_01_000002_create_jobs_table ................................................................................................. 63.96ms DONE
0001_01_01_000001_create_cache_table ................................................................................................ 16.58ms DONE
0001_01_01_000000_create_users_table ................................................................................................ 26.77ms DONE
2025_07_09_013525_create_payers_subscriptions_table ................................................................................. 11.78ms DONE

INFO Running migrations.

0001_01_01_000000_create_users_table ................................................................................................. 7.91ms DONE
0001_01_01_000001_create_cache_table ................................................................................................. 5.27ms DONE
0001_01_01_000002_create_jobs_table .................................................................................................. 6.88ms DONE
2025_07_09_013525_create_payers_subscriptions_table .................................................................................. 9.52ms FAIL

Illuminate\Database\QueryException

SQLSTATE[42704]: Undefined object: 7 ERROR: data type inet has no default operator class for access method "gist"
HINT: You must specify an operator class for the index or define a default operator class for the data type. (Connection: pgsql, SQL: create index "payers_subscriptions_client_internet_idx" on "payers_subscriptions" using gist ("client_internet"))

at vendor/laravel/framework/src/Illuminate/Database/Connection.php:822
818▕ $this->getName(), $query, $this->prepareBindings($bindings), $e
819▕ );
820▕ }
821▕
➜ 822▕ throw new QueryException(
823▕ $this->getName(), $query, $this->prepareBindings($bindings), $e
824▕ );
825▕ }
826▕ }
+9 vendor frames

10 database/migrations/2025_07_09_013525_create_payers_subscriptions_table.php:14
Illuminate\Support\Facades\Facade::__callStatic("create")
+38 vendor frames

49 artisan:16
Illuminate\Foundation\Application::handleCommand(Object(Symfony\Component\Console\Input\ArgvInput))

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions