Skip to content
Merged
Changes from all commits
Commits
Show all changes
44 commits
Select commit Hold shift + click to select a range
77ea76c
Merge pull request #29 from zenstackhq/dev
ymc9 Jun 17, 2025
2db2993
Merge pull request #31 from zenstackhq/dev
ymc9 Jun 20, 2025
ca05f6d
Merge pull request #44 from zenstackhq/dev
ymc9 Jun 28, 2025
50a3a79
Merge pull request #53 from zenstackhq/dev
ymc9 Jun 29, 2025
7322db8
Merge pull request #58 from zenstackhq/dev
ymc9 Jun 29, 2025
c225e62
Merge pull request #61 from zenstackhq/dev
ymc9 Jun 29, 2025
f638291
Merge pull request #66 from zenstackhq/dev
ymc9 Jul 2, 2025
d3e56be
Merge pull request #72 from zenstackhq/dev
ymc9 Jul 2, 2025
04323de
Merge pull request #82 from zenstackhq/dev
ymc9 Jul 9, 2025
8398575
Merge pull request #87 from zenstackhq/dev
ymc9 Jul 11, 2025
8f8d6de
Merge pull request #96 from zenstackhq/dev
ymc9 Jul 13, 2025
ed6cfe6
Merge pull request #99 from zenstackhq/dev
ymc9 Jul 17, 2025
30fc2fa
Merge pull request #119 from zenstackhq/dev
ymc9 Jul 28, 2025
c9d5e1d
Merge pull request #125 from zenstackhq/dev
ymc9 Jul 29, 2025
99eb798
Merge pull request #128 from zenstackhq/dev
ymc9 Jul 30, 2025
94a0c6f
Merge pull request #132 from zenstackhq/dev
ymc9 Jul 31, 2025
c76ae24
Merge pull request #137 from zenstackhq/dev
ymc9 Aug 4, 2025
4e359fc
Merge pull request #142 from zenstackhq/dev
ymc9 Aug 4, 2025
0040e9d
Merge pull request #149 from zenstackhq/dev
ymc9 Aug 6, 2025
9b36641
Merge pull request #154 from zenstackhq/dev
ymc9 Aug 12, 2025
c10e48f
Merge pull request #157 from zenstackhq/dev
ymc9 Aug 13, 2025
aec0096
Merge pull request #160 from zenstackhq/dev
ymc9 Aug 13, 2025
726b826
Merge pull request #163 from zenstackhq/dev
ymc9 Aug 13, 2025
a607b46
Merge pull request #166 from zenstackhq/dev
ymc9 Aug 14, 2025
acbd2ae
Merge pull request #174 from zenstackhq/dev
ymc9 Aug 15, 2025
6262b76
Merge pull request #177 from zenstackhq/dev
ymc9 Aug 15, 2025
c5660c5
Merge pull request #185 from zenstackhq/dev
ymc9 Aug 18, 2025
32691ce
Merge pull request #188 from zenstackhq/dev
ymc9 Aug 19, 2025
23c58bd
Merge pull request #191 from zenstackhq/dev
ymc9 Aug 20, 2025
be99d9a
Merge pull request #193 from zenstackhq/dev
ymc9 Aug 21, 2025
ccf968e
Merge pull request #198 from zenstackhq/dev
ymc9 Aug 22, 2025
c879a87
Merge pull request #205 from zenstackhq/dev
ymc9 Aug 24, 2025
c2d87a8
Merge pull request #209 from zenstackhq/dev
ymc9 Aug 26, 2025
74bbc28
Merge pull request #214 from zenstackhq/dev
ymc9 Aug 27, 2025
02d47dd
Merge pull request #224 from zenstackhq/dev
ymc9 Sep 1, 2025
31d2626
Merge pull request #228 from zenstackhq/dev
ymc9 Sep 1, 2025
a115040
Merge pull request #234 from zenstackhq/dev
ymc9 Sep 3, 2025
28ab57b
Merge pull request #238 from zenstackhq/dev
ymc9 Sep 4, 2025
96315a9
Merge pull request #249 from zenstackhq/dev
ymc9 Sep 12, 2025
495a512
Merge pull request #261 from zenstackhq/dev
ymc9 Sep 23, 2025
1770b12
Merge pull request #267 from zenstackhq/dev
ymc9 Sep 23, 2025
5f639de
Merge pull request #272 from zenstackhq/dev
ymc9 Sep 24, 2025
35a9e0d
Merge pull request #280 from zenstackhq/dev
ymc9 Oct 1, 2025
0bf7a4f
fix: don't inherit inherited map attribute
dhritcu Oct 9, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 12 additions & 1 deletion packages/sdk/src/prisma/prisma-schema-generator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,9 @@ export class PrismaSchemaGenerator {
}

const allAttributes = getAllAttributes(decl);
for (const attr of allAttributes.filter((attr) => this.isPrismaAttribute(attr))) {
for (const attr of allAttributes.filter(
(attr) => this.isPrismaAttribute(attr) && !this.isInheritedMapAttribute(attr, decl),
)) {
this.generateContainerAttribute(model, attr);
}

Expand All @@ -185,6 +187,15 @@ export class PrismaSchemaGenerator {
this.generateDelegateRelationForConcrete(model, decl);
}

private isInheritedMapAttribute(attr: DataModelAttribute, contextModel: DataModel) {
if (attr.$container === contextModel) {
return false;
}

const attrName = attr.decl.ref?.name ?? attr.decl.$refText;
return attrName === '@@map';
}

private isPrismaAttribute(attr: DataModelAttribute | DataFieldAttribute) {
if (!attr.decl.ref) {
return false;
Expand Down
Loading