cant insert after using drizzle-seed

schema
const usersTable = pgTable('users', {
id: integer().primaryKey().generatedAlwaysAsIdentity(),
email: varchar({ length: 255 }).notNull().unique(),
password: varchar({ length: 255 }).notNull(),
})
const usersTable = pgTable('users', {
id: integer().primaryKey().generatedAlwaysAsIdentity(),
email: varchar({ length: 255 }).notNull().unique(),
password: varchar({ length: 255 }).notNull(),
})
seed code
const password = await hash('password')
await seed(db, schema, { count: 20 }).refine((f) => ({
usersTable: {
columns: {
password: f.default({ defaultValue: password }),
},
},
}))
const password = await hash('password')
await seed(db, schema, { count: 20 }).refine((f) => ({
usersTable: {
columns: {
password: f.default({ defaultValue: password }),
},
},
}))
after seeding i cant insert any new rows because the id is already exists even though am not specifying it explicitly
0 Replies
No replies yetBe the first to reply to this messageJoin
Want results from more Discord servers?
Add your server