Replies: 2 comments
-
It's also interesting why once introspect a database and separate the tables to different files, drizzle is creating a new migration that recreates a bunch of things |
Beta Was this translation helpful? Give feedback.
0 replies
-
Maybe related: #2010 Even in an empty database generated with Drizzle, he drops constraints, even though nothing changed in the schema. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hey, I've got a database with ~40 tables.
I have tried to introspect the database which generated initial schema and commented migration. I haved moved the whole schema into multiple schema files to have it 1 file = 1 table and added relations.
In my config I have
schema: "./db/main/schema/*.ts",
Then I tried to run
drizzle-kit generate:pg --out ./drizzle/db/migrations --schema ./db/main/schema/*.ts
if there's something changed.And generated a huge migration file and I noticed that some generated commands are inconsistent.
For example it wants to drop a foreign key constraint which was generated by prisma some time ago.
any idea why is this happening? I'm really scared to migrate to Drizzle later on
Screenshot of the second migration which tries to drop all of my constraints
Search for an occurence in prisma migrations and there's only
ADD CONSTRAINT
Beta Was this translation helpful? Give feedback.
All reactions