Fix contributor website import script (#8404)
We had duplicate entries in the database for issueLabels/ prLabels
This commit is contained in:
@ -35,6 +35,7 @@ const insertMany = async (
|
||||
options?: {
|
||||
onConflictKey?: string;
|
||||
onConflictUpdateObject?: any;
|
||||
onConflictDoNothing?: boolean;
|
||||
},
|
||||
) => {
|
||||
const query = pgDb.insert(model).values(data);
|
||||
@ -50,6 +51,10 @@ const insertMany = async (
|
||||
}
|
||||
}
|
||||
|
||||
if (options?.onConflictDoNothing && !options?.onConflictKey) {
|
||||
return query.onConflictDoNothing().execute();
|
||||
}
|
||||
|
||||
if (options?.onConflictKey) {
|
||||
return query
|
||||
.onConflictDoNothing({
|
||||
|
||||
Reference in New Issue
Block a user