Should drizzle-kit introspect produce the same content as my existing schema?
In my sveltekit app /lib/server/schema.ts is my schema, changes are made and then
drizzle-kit push
pushed to my prod server.
If I run a drizzle-kit introspect
should this pulled schema == my /lib/server/schema.ts?
I was under the impression it would be, and that it was prior to 0.21.0 upgrade but I could 100% be mistaken.6 Replies
it should
could you please share the way to reproduce it, so we can fix it?
I'm trying to find a way to reproduce this, in the meantime, is this the correct workflow for updating my schema:
1. Update schema within
server\schema.ts
where this is opening lines prior to table definitions:
and because I am developing straight into supabase, I run drizzle-kit push
, where this is drizzle.config.ts
:
2. I then run drizzle-kit introspect
and my file in drizzle\schema.ts
has a whole bunch of things NOT in my server\schema.ts
such as:
note the exports aal_level
, code_challenge_method
, factor_status
also the table names in my original schema.ts are camelCase but when i introspect they're snake_case 🤷♂️
This is definitely user error, but I'm not sure how to get around it.you can change casing for introspect
Drizzle ORM - Config Reference
Drizzle ORM is a lightweight and performant TypeScript ORM with developer experience in mind.
please check this part of docs
Thanks for the reply @Andrew Sherman I have fixed the casing now. However my pulled schema has a lot of exports such as:
which just aren't in my original schema. Could this be the product of a migration that I could've erroneously started and if so, can I roll back or quash that migration?