@@ -126,7 +126,7 @@ export async function recordExternalDbSyncDeletion(
126126
127127 if ( target . tableName === "ProjectUser" ) {
128128 assertUuid ( target . projectUserId , "projectUserId" ) ;
129- const insertedCount = await tx . $executeRaw ( Prisma . sql `
129+ await tx . $executeRaw ( Prisma . sql `
130130 INSERT INTO "DeletedRow" (
131131 "id",
132132 "tenancyId",
@@ -150,18 +150,13 @@ export async function recordExternalDbSyncDeletion(
150150 FOR UPDATE
151151 ` ) ;
152152
153- if ( insertedCount !== 1 ) {
154- throw new StackAssertionError (
155- `Expected to insert 1 DeletedRow entry for ProjectUser, got ${ insertedCount } .`
156- ) ;
157- }
158153 return ;
159154 }
160155
161156 if ( target . tableName === "ContactChannel" ) {
162157 assertUuid ( target . projectUserId , "projectUserId" ) ;
163158 assertUuid ( target . contactChannelId , "contactChannelId" ) ;
164- const insertedCount = await tx . $executeRaw ( Prisma . sql `
159+ await tx . $executeRaw ( Prisma . sql `
165160 INSERT INTO "DeletedRow" (
166161 "id",
167162 "tenancyId",
@@ -193,17 +188,12 @@ export async function recordExternalDbSyncDeletion(
193188 FOR UPDATE
194189 ` ) ;
195190
196- if ( insertedCount !== 1 ) {
197- throw new StackAssertionError (
198- `Expected to insert 1 DeletedRow entry for ContactChannel, got ${ insertedCount } .`
199- ) ;
200- }
201191 return ;
202192 }
203193
204194 if ( target . tableName === "Team" ) {
205195 assertUuid ( target . teamId , "teamId" ) ;
206- const insertedCount = await tx . $executeRaw ( Prisma . sql `
196+ await tx . $executeRaw ( Prisma . sql `
207197 INSERT INTO "DeletedRow" (
208198 "id",
209199 "tenancyId",
@@ -227,18 +217,13 @@ export async function recordExternalDbSyncDeletion(
227217 FOR UPDATE
228218 ` ) ;
229219
230- if ( insertedCount !== 1 ) {
231- throw new StackAssertionError (
232- `Expected to insert 1 DeletedRow entry for Team, got ${ insertedCount } .`
233- ) ;
234- }
235220 return ;
236221 }
237222
238223 if ( target . tableName === "TeamMember" ) {
239224 assertUuid ( target . projectUserId , "projectUserId" ) ;
240225 assertUuid ( target . teamId , "teamId" ) ;
241- const insertedCount = await tx . $executeRaw ( Prisma . sql `
226+ await tx . $executeRaw ( Prisma . sql `
242227 INSERT INTO "DeletedRow" (
243228 "id",
244229 "tenancyId",
@@ -263,17 +248,12 @@ export async function recordExternalDbSyncDeletion(
263248 FOR UPDATE
264249 ` ) ;
265250
266- if ( insertedCount !== 1 ) {
267- throw new StackAssertionError (
268- `Expected to insert 1 DeletedRow entry for TeamMember, got ${ insertedCount } .`
269- ) ;
270- }
271251 return ;
272252 }
273253
274254 if ( target . tableName === "TeamMemberDirectPermission" ) {
275255 assertUuid ( target . permissionDbId , "permissionDbId" ) ;
276- const insertedCount = await tx . $executeRaw ( Prisma . sql `
256+ await tx . $executeRaw ( Prisma . sql `
277257 INSERT INTO "DeletedRow" (
278258 "id",
279259 "tenancyId",
@@ -302,17 +282,12 @@ export async function recordExternalDbSyncDeletion(
302282 FOR UPDATE
303283 ` ) ;
304284
305- if ( insertedCount !== 1 ) {
306- throw new StackAssertionError (
307- `Expected to insert 1 DeletedRow entry for TeamMemberDirectPermission, got ${ insertedCount } .`
308- ) ;
309- }
310285 return ;
311286 }
312287
313288 if ( target . tableName === "ProjectUserDirectPermission" ) {
314289 assertUuid ( target . permissionDbId , "permissionDbId" ) ;
315- const insertedCount = await tx . $executeRaw ( Prisma . sql `
290+ await tx . $executeRaw ( Prisma . sql `
316291 INSERT INTO "DeletedRow" (
317292 "id",
318293 "tenancyId",
@@ -340,17 +315,12 @@ export async function recordExternalDbSyncDeletion(
340315 FOR UPDATE
341316 ` ) ;
342317
343- if ( insertedCount !== 1 ) {
344- throw new StackAssertionError (
345- `Expected to insert 1 DeletedRow entry for ProjectUserDirectPermission, got ${ insertedCount } .`
346- ) ;
347- }
348318 return ;
349319 }
350320
351321 if ( target . tableName === "UserNotificationPreference" ) {
352322 assertUuid ( target . notificationPreferenceId , "notificationPreferenceId" ) ;
353- const insertedCount = await tx . $executeRaw ( Prisma . sql `
323+ await tx . $executeRaw ( Prisma . sql `
354324 INSERT INTO "DeletedRow" (
355325 "id",
356326 "tenancyId",
@@ -377,17 +347,12 @@ export async function recordExternalDbSyncDeletion(
377347 FOR UPDATE
378348 ` ) ;
379349
380- if ( insertedCount !== 1 ) {
381- throw new StackAssertionError (
382- `Expected to insert 1 DeletedRow entry for UserNotificationPreference, got ${ insertedCount } .`
383- ) ;
384- }
385350 return ;
386351 }
387352
388353 if ( target . tableName === "ProjectUserRefreshToken" ) {
389354 assertUuid ( target . refreshTokenId , "refreshTokenId" ) ;
390- const insertedCount = await tx . $executeRaw ( Prisma . sql `
355+ await tx . $executeRaw ( Prisma . sql `
391356 INSERT INTO "DeletedRow" (
392357 "id",
393358 "tenancyId",
@@ -411,17 +376,12 @@ export async function recordExternalDbSyncDeletion(
411376 FOR UPDATE
412377 ` ) ;
413378
414- if ( insertedCount !== 1 ) {
415- throw new StackAssertionError (
416- `Expected to insert 1 DeletedRow entry for ProjectUserRefreshToken, got ${ insertedCount } .`
417- ) ;
418- }
419379 return ;
420380 }
421381
422382 if ( target . tableName === "ProjectUserOAuthAccount" ) {
423383 assertUuid ( target . oauthAccountId , "oauthAccountId" ) ;
424- const insertedCount = await tx . $executeRaw ( Prisma . sql `
384+ await tx . $executeRaw ( Prisma . sql `
425385 INSERT INTO "DeletedRow" (
426386 "id",
427387 "tenancyId",
@@ -445,11 +405,6 @@ export async function recordExternalDbSyncDeletion(
445405 FOR UPDATE
446406 ` ) ;
447407
448- if ( insertedCount !== 1 ) {
449- throw new StackAssertionError (
450- `Expected to insert 1 DeletedRow entry for ProjectUserOAuthAccount, got ${ insertedCount } .`
451- ) ;
452- }
453408 return ;
454409 }
455410
@@ -458,7 +413,7 @@ export async function recordExternalDbSyncDeletion(
458413 assertNonEmptyString ( target . verificationCodeProjectId , "verificationCodeProjectId" ) ;
459414 assertNonEmptyString ( target . verificationCodeBranchId , "verificationCodeBranchId" ) ;
460415 assertUuid ( target . verificationCodeId , "verificationCodeId" ) ;
461- const insertedCount = await tx . $executeRaw ( Prisma . sql `
416+ await tx . $executeRaw ( Prisma . sql `
462417 INSERT INTO "DeletedRow" (
463418 "id",
464419 "tenancyId",
@@ -487,11 +442,6 @@ export async function recordExternalDbSyncDeletion(
487442 FOR UPDATE OF "VerificationCode"
488443 ` ) ;
489444
490- if ( insertedCount !== 1 ) {
491- throw new StackAssertionError (
492- `Expected to insert 1 DeletedRow entry for VerificationCode_TEAM_INVITATION, got ${ insertedCount } .`
493- ) ;
494- }
495445 return ;
496446 }
497447}
0 commit comments