Re-executing Drizzle Kit push fails after successful push
I'm getting the following error:
PL/pgSQL function "xata.pg_catalog".regnamespace(text) line 14 at RAISE
Is this an error with Xata or Drizzle? It loks like Xata.
Also, I'm not referencing publics
anywhere. Which seems like a typo?8 Replies
Hi, I believe this is a known issue and we're working on a fix. It should be available very soon.
Ah, ok, thank you. In the meantime I've found that the issue is triggered by the use of a composite primary key:
After successfully pushing this. Drizzle cannot introspect the db again and it results in the above error.
Can you specify your workspace id please, so we can check for logs in more depth?
Also a timestamp when this occurs would help us
Sure.
5713tr is the id
and the timestamp is basically for the last 20mins
Do you need it more specific?
We've seen this issue before and the dev team confirmed that we've pushed a fix for it, but there may be more conditions that it manifests under.
Would you be able to send us (here, or at [email protected] if you don't want to post it in public) the drizzle schema you're using so we can reproduce?
In this case it's fine, since it's pretty generic:
This is what drizzle kit with config
verbose: true
produces
table.ts
helpers.ts
Note: the columns like pgText
are just aliases.Thank you, we can reproduce the issue. I am following up with the dev team and will let you know as soon as we have an update.
Hi, we've just merged a fix for this issue. Can you try again and let me know if things work this time?
Thanks!
Hmm, I'm now getting the error:
FYI I have since changed the above code a bit, so there's no
error: column "guestId" is in a primary key
id
field inside the XATA_SCHEMA_FIELDS
variable. Since that doesn't make sense.
Scratch that error above. It seems to be working! 🎉
Drizzle push somehow thinks it needs to remove the not nulls after adding the index. Since I wanted to specify notNull() anyways I added that.