Skip to content

[BUG]: drizzle-kit pull generates string instead of sql statement for default value #5093

@telcy

Description

@telcy

Report hasn't been filed before.

  • I have verified that the bug I'm about to report hasn't been filed before.

What version of drizzle-orm are you using?

1.0.0-beta.2-b782ae1

What version of drizzle-kit are you using?

1.0.0-beta.2-b782ae1

Other packages

No response

Describe the Bug

CREATE TABLE "contact" (
    "id" uuid PRIMARY KEY DEFAULT uuidv7()
);

pnpm drizzle-kit pull

generates

export const contact = pgTable("contact", {
  id: uuid().default("uuidv7()").primaryKey(),
});

expected

export const contact = pgTable("contact", {
  id: uuid()
    .default(sql`uuidv7()`)
    .primaryKey(),
});

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions