error: type "userrole[]" does not exist

So when I'm running db:push I'm getting an error that the enum userrole doesnt exist. I have the enum here and it shows in the supabase enums list as well. This is the code
enum
export const userRole = pgEnum("UserRole", ["ADMIN", "TEACHER", "DEVELOPER", "STUDENT", "ALUMNI", "GUEST"]);

table attr
roles: userRole("roles")
.array()
.default(sql`ARRAY['STUDENT']::UserRole[]`)
.notNull()
enum
export const userRole = pgEnum("UserRole", ["ADMIN", "TEACHER", "DEVELOPER", "STUDENT", "ALUMNI", "GUEST"]);

table attr
roles: userRole("roles")
.array()
.default(sql`ARRAY['STUDENT']::UserRole[]`)
.notNull()
This is the generated SQL
ALTER TABLE "users" ADD COLUMN "roles" UserRole[] DEFAULT ARRAY['STUDENT']::UserRole[] NOT NULL;
ALTER TABLE "users" ADD COLUMN "roles" UserRole[] DEFAULT ARRAY['STUDENT']::UserRole[] NOT NULL;
We're using drizzle kit version 0.21.2. Any help is appreciated, thank you!
No description
0 Replies
No replies yetBe the first to reply to this messageJoin
Want results from more Discord servers?
Add your server