I have spaces that can have many members and one author how do i define my schema

this is the current schema but i think the index for spaces should not be author ID
3 Replies
Scot
Scot2y ago
Hard to know without a) how much data you expect this to handle b) what kind of queries you expect to run (Also c what storage engine are you using?)
teaonrocks
teaonrocks2y ago
not much data, queries to get the space's info thats in the schema, add task remove task, add members remove members im using mysql planetscale to be exact
JulieCezar
JulieCezar2y ago
From the MySQL docs MySQL requires that foreign key columns be indexed; if you create a table with a foreign key constraint but no index on a given column, an index is created. I don't know if Prisma does something but just so you know.... Also in these situations I just index by the AuthorId and didn't run into problems yet
Want results from more Discord servers?
Add your server