nikhil
nikhil
DTDrizzle Team
Created by nikhil on 12/2/2024 in #help
drizzle-seed TypeError: Cannot read properties of undefined (reading 'length')
this is the error im getting (any help would be appreciated!):
/node_modules/drizzle-seed/index.mjs:131268
&& !values.every((val) => val.values.length !== 0)) {
^
TypeError: Cannot read properties of undefined (reading 'length')
/node_modules/drizzle-seed/index.mjs:131268
&& !values.every((val) => val.values.length !== 0)) {
^
TypeError: Cannot read properties of undefined (reading 'length')
this is my schema:
export const profile = pgTable("profile", {
id: uuid().defaultRandom().primaryKey(),
name: text().notNull(),
...timestamps,
});

export const shiftAssignment = pgTable("shift_assignment", {
id: uuid().defaultRandom().primaryKey(),
profileId: uuid().references(() => profile.id, { onDelete: "cascade" }),
date: date(),
...timestamps,
});
export const profile = pgTable("profile", {
id: uuid().defaultRandom().primaryKey(),
name: text().notNull(),
...timestamps,
});

export const shiftAssignment = pgTable("shift_assignment", {
id: uuid().defaultRandom().primaryKey(),
profileId: uuid().references(() => profile.id, { onDelete: "cascade" }),
date: date(),
...timestamps,
});
this is my seed:
await reset(db, schema);
await seed(db, schema).refine((f) => ({
profile: {
columns: {
name: f.fullName(),
},
count: 10,
with: {
shiftAssignment: 3,
},
},
}));
await reset(db, schema);
await seed(db, schema).refine((f) => ({
profile: {
columns: {
name: f.fullName(),
},
count: 10,
with: {
shiftAssignment: 3,
},
},
}));
1 replies
DTDrizzle Team
Created by nikhil on 11/29/2023 in #help
Supabase primary key type
No description
5 replies