Allow customizing many to many join table name #9462
lmiller1990
started this conversation in
Feature requests
Replies: 1 comment
-
I am learning more. I now see that most of this is in Prisma-land. One other question - does keystone even support explicit many to many? Seems no? |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Related
I found this one: #9119
Alternative / What I tried
Maybe using
I can't seem to get it to work. This compiles what looks like the desired schema but I get an error
Issue
I am working with an existing schema that uses a join table like so:
Where it is a Many to Many via
marker_category
.marker_category
has 3 columns:id
(unique),category_id
andmarker_id
, which are how the many to many is represented.Prisma allows us to configure this, but keystone is hard-coded to use a specific convention:
keystone/packages/core/src/lib/core/resolve-relationships.ts
Line 182 in 218de8d
I actually wrote my own
schema.prisma
that works as expected in isolation, but when I declare my relationships in theschema.ts
, keystone's codegen overrides myschema.prisma
.I tried the
--no-prisma
flag, but I get an errorNot sure if this is intended - even if this did work, the keystone convention for join tables isn't compatible with my schema.
Ideally, we'd be able to customize this:
... or something to that meaning. I could make a PR if there is interest. I really want to use Keystone but this is a blocker.
Beta Was this translation helpful? Give feedback.
All reactions