Skip to content
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

Not picking up primary keys from supabase? #65

Closed
Emsu opened this issue May 25, 2023 · 1 comment
Closed

Not picking up primary keys from supabase? #65

Emsu opened this issue May 25, 2023 · 1 comment

Comments

@Emsu
Copy link

Emsu commented May 25, 2023

Here's a sample table definition of a live table in postgres

create table
  public.knowledge_bases (
    id bigint generated by default as identity not null,
    created_at timestamp with time zone null default now(),
    name text null,
    org_id text null,
    index_name text null,
    constraint knowledge_bases_pkey primary key (id)
  ) tablespace pg_default;

It's picking up id as an int. But doesn't see the primary key constraint. What can I do to fix this?

Here's what the npx drizzle-kit introspect:pg is generating:

export const knowledgeBases = pgTable("knowledge_bases", {
	// You can use { mode: "bigint" } if numbers are exceeding js number limitations
	id: bigint("id", { mode: "number" }).notNull(),
	createdAt: timestamp("created_at", { withTimezone: true, mode: 'string' }).defaultNow(),
	name: text("name"),
	orgId: text("org_id"),
	indexName: text("index_name"),
});
@AndriiSherman
Copy link
Member

Fixed in drizzle-kit@0.18.1

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

2 participants