|
@@ -33,3 +33,18 @@ dataLoaderJsContentLines.splice(
|
|
|
`
|
|
|
)
|
|
|
fs.writeFileSync(dataLoaderJsPath, dataLoaderJsContentLines.join('\n'))
|
|
|
+
|
|
|
+// FIXME: Temporary fix for "table name x specified more than once"
|
|
|
+const baseServiceJsPath = path.resolve(__dirname, '../../../node_modules/@joystream/warthog/dist/core/BaseService.js')
|
|
|
+const baseServiceJsContent = fs.readFileSync(baseServiceJsPath).toString()
|
|
|
+const baseServiceJsContentLines = baseServiceJsContent.split('\n')
|
|
|
+baseServiceJsContentLines.splice(
|
|
|
+ baseServiceJsContentLines.findIndex((l) => l.match(/function common/)) + 1,
|
|
|
+ 4, // remove 4 lines (function body)
|
|
|
+ `const uuid = require('uuid/v4')
|
|
|
+ const foreignTableAlias = uuid().replace('-', '')
|
|
|
+ var foreingIdColumn = "\\"" + foreignTableAlias + "\\".\\"" + foreignColumnMap[foreignColumnName] + "\\"";
|
|
|
+ parameters.topLevelQb.leftJoin(foreignTableName, foreignTableAlias, localIdColumn + " = " + foreingIdColumn);
|
|
|
+ addWhereCondition(parameters, foreignTableAlias, foreignColumnMap);`
|
|
|
+)
|
|
|
+fs.writeFileSync(baseServiceJsPath, baseServiceJsContentLines.join('\n'))
|