Open aokigit opened 3 days ago
Same Error for me, using supabase
exact same thing here, seems like some null checks are missing in applyPgSnapshotsDiff
exactly the same thing for me too
the same thing for me too
same problem occurring for me as well. not sure what's up with this; a recent migration worked out alright--i'm using xata postgres
I'm having the same error
i did something really weird...so i have multiple schemas defined in my schema.ts and i removed all of them except one. did npx drizzle-kit generate
and then npx drizzle-kit migrate
. repeated the process by re-adding my schemas and somehow everything worked...not sure what's up with that though.
same error for me with postgres
same
drizzle-kit generate
I have the same, for postgres generate.
Update: Tried with 0.26.2, tells me to upgrade...
This version of drizzle-kit is outdated Please update drizzle-kit package to the latest version 👍
I tried the "delete schema, generate, revert partially, generate again, then use latest schema, and generate one more time" and it worked somehow
a folder with 'bad' migrations was my issue. deleted that and all's well now🙌🏽
same
It seems there is a missing nullcheck and adding an optional chaining operator in drizzle-kit code fixes the issue. I cannot assure it will works if you avec RLS defined, but if you don't you should be able to generate migrations correctly.
node_modules/drizzle-kit/bin.cjs
if (table4.isRLSEnabled !== tableInPreviousState.isRLSEnabled) {
With
if (table4.isRLSEnabled !== tableInPreviousState?.isRLSEnabled) {
About the issue:
tableInPreviousState
is known to be possibly undefined as line 29878 checks for it:
const policiesInPreviousState = tableInPreviousState ? Object.keys(tableInPreviousState.policies) : [];
There must be a type issue or misconfiguration somewhere that Typescript did not catch it at compile time.
pushing a fix in 30 mins
sorry for a long fix for this blocker
Just tested with drizzle-kit@rls-fix
Should be fixed there. Including in the latest now
tysm!
What version of
drizzle-orm
are you using?0.36.0
What version of
drizzle-kit
are you using?0.27.1
Describe the Bug
When using
drizzle-kit push
I'm receiving the following error:TypeError: Cannot read properties of undefined (reading 'isRLSEnabled')
My client setup:
Drizzle config:
Expected behavior
No response
Environment & setup
Development