Skip to content

[BUG]: enum as array, not possible? #1564

Closed
@nathanielrich

Description

@nathanielrich

What version of drizzle-orm are you using?

0.29.0

What version of drizzle-kit are you using?

0.20.4

Describe the Bug

a simple example:

export const userRoles = pgEnum("user_role", ["admin", "member"]);

export const user = pgTable("user", {
	id: uuid("id").notNull().defaultRandom().primaryKey(),
	roles: userRoles("roles").notNull().default("member").array(),
});

when i try to migrate this, i got the error:

...

/[email protected]/node_modules/postgres/cjs/src/connection.js:790
    const error = Errors.postgres(parseError(x))
                         ^
PostgresError: type "user_role[]" does not exist

...

is it not implemented or is this a bug...?

thx.

Expected behavior

No response

Environment & setup

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions