Does type "serial" exist in Xata/Drizzle?
I keep getting
error: type "serial" does not exist
when I push my schema: id: serial('id').primaryKey().notNull(),
and if I do introspect I get this:
id: integer("id").default(nextval('cv_theque_profiles_id_seq'::regclass)).primaryKey().notNull(),
which is not valid syntaxically5 Replies
Xata supports it, the error looks like Drizzle does not know of the type.
Are you importing it from pg-core?
Just tested it, it correctly creates a sequence in Xata. There may be a bug in how drizzle handles it
There's a reported drizzle bug for this: https://github.com/drizzle-team/drizzle-orm/issues/2183
GitHub
[BUG]: error: type "serial" does not exist · Issue #2183 · drizzle-...
What version of drizzle-orm are you using? 0.30.8 What version of drizzle-kit are you using? 0.20.16 Describe the Bug After generating a migration with drizzle-kit, running drizzle-kit push:pg resu...
I have created everything from scratch again:
this my drizzle schema:
and that's is how it reflects on Xata dashboard after pushing (image attached)
and this is what I get after introspecting:
The Xata expression is correct, this is the Postgres-native syntax for Drizzle's "serial". Drizzle seems to have a bug handling this, after creating it (see the linked issue)
I see. Thank you again for clarifying.