You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have 2 lists with exactly the same fields and code, just different names. I have set them to only appear on item view of the list [videoObject] when they are not null. What happens is that one of them (Legacy_Video), never appears. I checked the item variable of the [videoObject] and legacyvideoID never appears (null or with a value), and xrvideoID always appears.
As you can see by the code there is no reason for them to have different behaviours, and there is no reason for [Legacy_Video] not showing as a field of [videoObject] list. What is hapening with [videoObject] is also happening with another list [videoCastCredits] which has the exact same logic, in relationship with [XR_Video] and [Legacy_Video]. So it must be something related with [Legacy_Video] list, although the code is exaclty the same as [XR_Video], that appears.
I tried everything:
deleted .keystone folder
deleted node_modules
deleted schema.graphql
deleted schema.prisma
deleted migrations folder
cleaned yarn cache
deleted database
created database with a different name
reinstalled yarn
Each time I do yarn install, I get an error in the end for not having schema.prisma. I then do yarn run dev and it generates everything, but the schemas that should be the same come always different and [Legacy_Video] never appears in the ui or the [item] object variable of [videoObject]. I tried it several times. It's always the same.
I wonder if there is any kind of cache that is storing some old schema, that i don't know about.
The prisma schema of both [XR_Video] and [Legacy_Video] should be exactly the same. And [Legacy_Video] should appear as a field of videoObject. But both don't occur.
Using debian 12, node v18.19.0
Grateful for your help.
The text was updated successfully, but these errors were encountered:
jj-matos
changed the title
Generating different schemas for exact same list code, and one doesn't appear in another list as relationship, as it should.
Keystone generating 2 different relationship schemas for exact same list code, and one doesn't appear in the other related list as a field.
Aug 27, 2024
model videoObject {
id String @id @default(cuid())
name String @default("")
legacyVideo legacyVideo? @relation("legacyVideo_videoObject")
xrVideo xrVideo? @relation("videoObject_xrVideo", fields: [xrVideoId], references: [id])
xrVideoId String? @unique @map("xrVideo")
}
model legacyVideo {
id String @id @default(cuid())
name String @default("")
videoObject videoObject? @relation("legacyVideo_videoObject", fields: [videoObjectId], references: [id])
videoObjectId String? @unique @map("videoObject")
}
model xrVideo {
id String @id @default(cuid())
name String @default("")
videoObject videoObject? @relation("videoObject_xrVideo")
}
And a DB (SQLite) schema of:
CREATETABLEIF NOT EXISTS "videoObject" (
"id"TEXTNOT NULLPRIMARY KEY,
"name"TEXTNOT NULL DEFAULT '',
"xrVideo"TEXT,
CONSTRAINT"videoObject_xrVideo_fkey"FOREIGN KEY ("xrVideo") REFERENCES"xrVideo" ("id") ON DELETESETNULLONUPDATE CASCADE
);
CREATEUNIQUE INDEX "videoObject_xrVideo_key" ON"videoObject"("xrVideo");
CREATETABLEIF NOT EXISTS "legacyVideo" (
"id"TEXTNOT NULLPRIMARY KEY,
"name"TEXTNOT NULL DEFAULT '',
"videoObject"TEXT,
CONSTRAINT"legacyVideo_videoObject_fkey"FOREIGN KEY ("videoObject") REFERENCES"videoObject" ("id") ON DELETESETNULLONUPDATE CASCADE
);
CREATEUNIQUE INDEX "legacyVideo_videoObject_key" ON"legacyVideo"("videoObject");
CREATETABLEIF NOT EXISTS "xrVideo" (
"id"TEXTNOT NULLPRIMARY KEY,
"name"TEXTNOT NULL DEFAULT ''
);
Clearly this isn't correct – the videoObject column is totally missing from xrVideo. I see no reason this config shouldn't be valid. Is there some limitation on the number of one-to-one relationships that exist on a list?
I have 2 lists with exactly the same fields and code, just different names. I have set them to only appear on item view of the list [videoObject] when they are not null. What happens is that one of them (Legacy_Video), never appears. I checked the item variable of the [videoObject] and legacyvideoID never appears (null or with a value), and xrvideoID always appears.
As you can see by the code there is no reason for them to have different behaviours, and there is no reason for [Legacy_Video] not showing as a field of [videoObject] list. What is hapening with [videoObject] is also happening with another list [videoCastCredits] which has the exact same logic, in relationship with [XR_Video] and [Legacy_Video]. So it must be something related with [Legacy_Video] list, although the code is exaclty the same as [XR_Video], that appears.
I tried everything:
Each time I do yarn install, I get an error in the end for not having schema.prisma. I then do yarn run dev and it generates everything, but the schemas that should be the same come always different and [Legacy_Video] never appears in the ui or the [item] object variable of [videoObject]. I tried it several times. It's always the same.
I wonder if there is any kind of cache that is storing some old schema, that i don't know about.
keystone generated schema.prisma:
in [videoObject] list:
in Legacy_Video list (same as XR_Video):
The prisma schema of both [XR_Video] and [Legacy_Video] should be exactly the same. And [Legacy_Video] should appear as a field of videoObject. But both don't occur.
Using debian 12, node v18.19.0
Grateful for your help.
The text was updated successfully, but these errors were encountered: