Drizzle seed stuck and no info displayed
Hi all, im experimenting with using drizzle-seed to seed my db instead of using raw sqls
I have a script that is basically a slight modification of the tutorial from the docs, but it seems to hand/gets stuck when I run it. Any ideas why and what I could do? There's no debug messages either so its not very helpful.
6 Replies
CC: @OleksiiKH
Had exact same issue. You probably don't expose all relevant schema tables for drizzle seed. Make sure you provide tables that bloodPressure has fk's on.
Should've created an issue. My bad. Will try to replicate rereproduce
Ahh will try that. But yes that table has dependencies on another table
I have a dependency on the user table. Is it possible to generate seed data with a hardcoded userid
Hi, I fixed the bug locally. It will be included in the next release. (PR -> https://github.com/drizzle-team/drizzle-orm/pull/3808)
Yes, you can generate a hardcoded userId, as shown in the example below.
However, you need to ensure that the
users
table already contains the IDs you are providing to the valuesFromArray
generator in refine
.Hey thanks for the code there. The above seems to work only if we provide both the users table and bloodPressure into the seed schema.
I was wondering if we can seed a table with preexisting users data
Do you know if that is possible?
Hi, the code above works in the latest version of drizzle-seed (0.2.1, the one without the bug) without requiring the users table to be included in the seed schema.