Skip to content

Commit

Permalink
Update schema error messages
Browse files Browse the repository at this point in the history
  • Loading branch information
L-Mario564 committed Oct 2, 2024
1 parent 61faf94 commit b5b5c72
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions drizzle-kit/src/validate-schema/schema.ts
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,11 @@ export class ValidateSchema {
);

return {
message: `${this.schema ? `In schema ${entityName(undefined, this.schema, true)}, ` : ''}${list} have the same name, ${fmtValue(name, true)}`,
message: `${
this.schema
? `In schema ${entityName(undefined, this.schema, true)}, ${list} have `
: `Database has ${list} with `
}the same name, ${fmtValue(name, true)}`,
hint: 'Each entity (table, view, materialized view, enum and sequence) in a schema must have a unique name. Rename any of the conflicting entities',
};
});
Expand Down Expand Up @@ -114,7 +118,11 @@ export class ValidateSchema {
);

return {
message: `${this.schema ? `In schema ${entityName(undefined, this.schema, true)}, ` : ''}${list} have the same name, ${fmtValue(name, true)}`,
message: `${
this.schema
? `In schema ${entityName(undefined, this.schema, true)}, ${list} have `
: `Database has ${list} with `
}the same name, ${fmtValue(name, true)}`,
hint: 'Each constraint (primary key, foreign key, check and unique) and index in a schema must have a unique name. Rename any of the conflicting constraints/indexes',
};
});
Expand Down

0 comments on commit b5b5c72

Please sign in to comment.