Skip to content

Commit

Permalink
diff cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
irvinzz committed Aug 4, 2024
1 parent 420c116 commit c3095d1
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions packages/schema/src/plugins/prisma/schema-generator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ const PROVIDERS_SUPPORTING_NAMED_CONSTRAINTS = ['postgresql', 'mysql', 'cockroac

// Some database providers like postgres and mysql have default limit to the length of identifiers
// Here we use a conservative value that should work for most cases, and truncate names if needed
export const IDENTIFIER_NAME_MAX_LENGTH = 50 - DELEGATE_AUX_RELATION_PREFIX.length;
const IDENTIFIER_NAME_MAX_LENGTH = 50 - DELEGATE_AUX_RELATION_PREFIX.length;

/**
* Generates Prisma schema file
Expand Down Expand Up @@ -556,7 +556,7 @@ export class PrismaSchemaGenerator {
if (name.length <= IDENTIFIER_NAME_MAX_LENGTH) {
return name;
}

const shortName = name.slice(0, IDENTIFIER_NAME_MAX_LENGTH);
const entry = this.shortNameMap.get(shortName);
if (!entry) {
Expand All @@ -573,7 +573,7 @@ export class PrismaSchemaGenerator {
}
}
}

private nameRelationsInheritedFromDelegate(model: PrismaDataModel, decl: DataModel) {
if (this.mode !== 'logical') {
return;
Expand Down

0 comments on commit c3095d1

Please sign in to comment.