-
-
Notifications
You must be signed in to change notification settings - Fork 90
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Reused existing relation name to produce opposite relation while expa…
…nding polymorphic relations (#1572) Co-authored-by: Yiming <[email protected]> Co-authored-by: ymc9 <[email protected]>
- Loading branch information
1 parent
2760b41
commit 4c6cde6
Showing
2 changed files
with
31 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
import { loadSchema } from '@zenstackhq/testtools'; | ||
describe('issue 1575', () => { | ||
it('regression', async () => { | ||
await loadSchema( | ||
` | ||
model UserAssets { | ||
id String @id @default(cuid()) | ||
videoId String | ||
videoStream Asset @relation("userVideo", fields: [videoId], references: [id]) | ||
subtitleId String | ||
subtitlesAsset Asset @relation("userSubtitles", fields: [subtitleId], references: [id]) | ||
} | ||
model Asset { | ||
id String @id @default(cuid()) | ||
type String | ||
userVideo UserAssets[] @relation("userVideo") | ||
userSubtitles UserAssets[] @relation("userSubtitles") | ||
@@delegate(type) | ||
} | ||
model Movie extends Asset { | ||
duration Int | ||
} | ||
` | ||
); | ||
}); | ||
}); |