Add schema to table so it will match the relation data. Fixes mysql problem.
(table: string)
| 587 | |
| 588 | /** Add schema to table so it will match the relation data. Fixes mysql problem. */ |
| 589 | private addSchemaForRelations(table: string) { |
| 590 | if (!table.includes('.') && !this.relations.some(rel => rel.childTable === table)) { |
| 591 | // if no tables match the given table, then assume we need to fix the schema |
| 592 | const first = this.relations.find(rel => !!rel.childTable); |
| 593 | if (first) { |
| 594 | const [schemaName, tableName] = qNameSplit(first.childTable); |
| 595 | if (schemaName) { |
| 596 | table = qNameJoin(schemaName, table); |
| 597 | } |
| 598 | } |
| 599 | } |
| 600 | return table; |
| 601 | } |
| 602 | |
| 603 | private addTypeScriptAssociationMixins(table: string): Record<string, any> { |
| 604 | const sp = this.space[1]; |
no test coverage detected