separating relations to different file results in typescript issues

I have updated my config to this and just move the relations to relations.ts
schema: ["./server/db/schema.ts", "./server/db/relations.ts"],
schema: ["./server/db/schema.ts", "./server/db/relations.ts"],
It results in this kind of type error.
error TS2339: Property 'name' does not exist on type 'never'.

29 .map((p) => p.permission.name);
error TS2339: Property 'name' does not exist on type 'never'.

29 .map((p) => p.permission.name);
1 Reply
rphlmr âš¡
rphlmr ⚡•4mo ago
👋 where is this? (the snippet with schema) if it is the drizzle config, I am not sure it is requires. but in your drizzle client, you now need to do that:
const db = drizzle(client, {
schema: {
...schema,
...relations,
},
});
const db = drizzle(client, {
schema: {
...schema,
...relations,
},
});
Want results from more Discord servers?
Add your server