Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
H
hdfc-common-utility
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Jira
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Roshan Suvarnkar
hdfc-common-utility
Compare revisions
8f7de0be7c2895fc2295a113e03c3f94b7890382 to 01d8d141a46940bcbcd3bac15e31167285591bcb
Compare revisions
Changes are shown as if the
source
revision was being merged into the
target
revision.
Learn more about comparing revisions.
Source
roshan.suvarnkar/hdfc-common-utility
Select target project
No results found
01d8d141a46940bcbcd3bac15e31167285591bcb
Select Git revision
Branches
develop
fSearch
fuzzySearch
fuzzySearchChanges
hotFixInFuzzySearch
hotFixSeedFunction
master
7 results
Swap
Target
roshan.suvarnkar/hdfc-common-utility
Select target project
roshan.suvarnkar/hdfc-common-utility
1 result
8f7de0be7c2895fc2295a113e03c3f94b7890382
Select Git revision
Branches
develop
fSearch
fuzzySearch
fuzzySearchChanges
hotFixInFuzzySearch
hotFixSeedFunction
master
7 results
Show changes
Only incoming changes from source
Include changes to target since source was created
Compare
Commits on Source
2
did changes in multiple seed function
· 70ab510c
Prathviraj Suryakant Thokal
authored
1 month ago
70ab510c
Merge branch 'hotFixSeedFunction' into 'develop'
· 01d8d141
Roshan Suvarnkar
authored
1 month ago
did changes in multiple seed function See merge request
!6
01d8d141
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/utils/prisma-seed.util.ts
+3
-1
3 additions, 1 deletion
src/utils/prisma-seed.util.ts
with
3 additions
and
1 deletion
src/utils/prisma-seed.util.ts
View file @
01d8d141
...
...
@@ -116,6 +116,7 @@ export const seedWithRelation = async <
export
type
ForeignKeyConfig
<
ChildType
>
=
{
parentModel
:
keyof
PrismaClient
;
parentLookupKey
:
string
;
parentPrimaryKey
?:
string
;
childReferenceKey
:
keyof
ChildType
;
childForeignKeyField
:
keyof
ChildType
;
};
...
...
@@ -141,7 +142,8 @@ export const seedWithMultipleParents = async <
const
map
=
new
Map
<
any
,
any
>
();
for
(
const
parent
of
parents
)
{
map
.
set
(
parent
[
fk
.
parentLookupKey
],
parent
.
id
);
const
id
=
fk
.
parentPrimaryKey
??
"
id
"
;
map
.
set
(
parent
[
fk
.
parentLookupKey
],
parent
[
id
]);
}
lookupMaps
[
String
(
fk
.
parentModel
)]
=
map
;
...
...
This diff is collapsed.
Click to expand it.