We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
const generateModels = ( manyToManyFields: DMMF.Field[], models: DMMF.Model[], manyToManyTables: DMMF.Model[] = [] ): DMMF.Model[] => { const manyFirst = manyToManyFields.shift(); if (!manyFirst) { return manyToManyTables; } const manySecond = manyToManyFields.find((field) => field.relationName === manyFirst.relationName); if (!manySecond) { return manyToManyTables; } manyToManyTables.push({ dbName: `_${manyFirst.relationName}`, name: manyFirst.relationName || '', primaryKey: null, uniqueFields: [], uniqueIndexes: [], fields: generateJoinFields([manyFirst, manySecond], models), }); return generateModels( manyToManyFields.filter((field) => field.relationName !== manyFirst.relationName), models, manyToManyTables ); };
manyToManyFields.shift() mutates the manyToManyFields array and leads to the non-mapping / partial loss of many to many tables in some cases
manyToManyFields.shift()
Are you open to a PR ?
The text was updated successfully, but these errors were encountered:
No branches or pull requests
manyToManyFields.shift()
mutates the manyToManyFields array and leads to the non-mapping / partial loss of many to many tables in some casesAre you open to a PR ?
The text was updated successfully, but these errors were encountered: