Skip to content

[BUG]: drizzle-kit pull outputs access method name instead of operator class for ivfflat indexes #5495

@petrbela

Description

@petrbela

What version of drizzle-orm are you using?

1.0.0-beta.17-67b1795

What version of drizzle-kit are you using?

1.0.0-beta.17-67b1795

Describe the Bug

When running drizzle-kit pull against a PostgreSQL database that has ivfflat indexes (from pgvector), the generated migration SQL uses the access method name (ivfflat) in the operator class position instead of the actual operator class (e.g. vector_cosine_ops).

Production index (from pg_indexes):

CREATE INDEX idx_claims_embedding ON claims USING ivfflat (claim_embedding vector_cosine_ops)

What drizzle-kit pull generates:

index("idx_claims_embedding").using("ivfflat", table.claimEmbedding.asc().nullsLast().op("ivfflat"))
CREATE INDEX "idx_claims_embedding" ON "claims" USING ivfflat ("claim_embedding" ivfflat);

Expected output:

index("idx_claims_embedding").using("ivfflat", table.claimEmbedding.asc().nullsLast().op("vector_cosine_ops"))
CREATE INDEX "idx_claims_embedding" ON "claims" USING ivfflat ("claim_embedding" vector_cosine_ops);

This affects all ivfflat indexes regardless of which operator class they use. The generated SQL fails when applied because ivfflat is not a valid operator class — it's the index access method.

Expected behavior

drizzle-kit pull should output the actual operator class from pg_opclass (e.g. vector_cosine_ops, vector_l2_ops, vector_ip_ops) instead of the access method name.

Environment & setup

  • PostgreSQL 17 (Neon)
  • pgvector extension installed
  • 8 ivfflat indexes, all using vector_cosine_ops — all pulled incorrectly

Metadata

Metadata

Assignees

No one assigned

    Labels

    1.0.0-beta.*bugSomething isn't workingbug/fixed-in-betaThis bug has been fixed in beta (or will be soon).

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions