@mikro-orm/sql
Advanced tools
+2
-2
| { | ||
| "name": "@mikro-orm/sql", | ||
| "version": "7.0.0-dev.199", | ||
| "version": "7.0.0-dev.200", | ||
| "description": "TypeScript ORM for Node.js based on Data Mapper, Unit of Work and Identity Map patterns. Supports MongoDB, MySQL, PostgreSQL and SQLite databases as well as usage with vanilla JavaScript.", | ||
@@ -59,4 +59,4 @@ "type": "module", | ||
| "peerDependencies": { | ||
| "@mikro-orm/core": "7.0.0-dev.199" | ||
| "@mikro-orm/core": "7.0.0-dev.200" | ||
| } | ||
| } |
@@ -484,7 +484,15 @@ import { DecimalType, EntitySchema, RawQueryFragment, ReferenceKind, t, Type, UnknownType, Utils, } from '@mikro-orm/core'; | ||
| } | ||
| if (!fks.some(fk => fk !== currentFk && fk.referencedTableName === currentFk.referencedTableName) && !this.getColumn(currentFk.referencedTableName)) { | ||
| // FK is the only one in this table that references this other table. | ||
| // Strip schema prefix from referenced table name (e.g., "public.fr_usuario" -> "fr_usuario") | ||
| const getTableName = (fullName) => { | ||
| const parts = fullName.split('.'); | ||
| return parts[parts.length - 1]; | ||
| }; | ||
| const referencedTableName = getTableName(currentFk.referencedTableName); | ||
| // Check for conflicts using stripped table names (handles cross-schema FKs to same-named tables) | ||
| const hasConflictingFk = fks.some(fk => fk !== currentFk && getTableName(fk.referencedTableName) === referencedTableName); | ||
| if (!hasConflictingFk && !this.getColumn(referencedTableName)) { | ||
| // FK is the only one in this table that references a table with this name. | ||
| // The name of the referenced table is not shared with a column in this table, | ||
| // so it is safe to output prop name based on the referenced entity. | ||
| return currentFk.referencedTableName; | ||
| return referencedTableName; | ||
| } | ||
@@ -491,0 +499,0 @@ // Any ambiguous FK is rendered with a name based on the FK constraint name |
Sorry, the diff of this file is not supported yet
Network access
Supply chain riskThis module accesses the network.
Found 1 instance in 1 package
Long strings
Supply chain riskContains long string literals, which may be a sign of obfuscated or packed code.
Found 1 instance in 1 package
URL strings
Supply chain riskPackage contains fragments of external URLs or IP addresses, which the package may be accessing at runtime.
Found 1 instance in 1 package
Network access
Supply chain riskThis module accesses the network.
Found 1 instance in 1 package
Long strings
Supply chain riskContains long string literals, which may be a sign of obfuscated or packed code.
Found 1 instance in 1 package
URL strings
Supply chain riskPackage contains fragments of external URLs or IP addresses, which the package may be accessing at runtime.
Found 1 instance in 1 package
846290
0.06%14030
0.06%