@@ -873,15 +873,7 @@ export class PostgresStorageAdapter implements StorageAdapter {
873
873
'CREATE TABLE IF NOT EXISTS "_SCHEMA" ( "className" varChar(120), "schema" jsonb, "isParseClass" bool, PRIMARY KEY ("className") )'
874
874
)
875
875
. catch ( error => {
876
- if (
877
- error . code === PostgresDuplicateRelationError ||
878
- error . code === PostgresUniqueIndexViolationError ||
879
- error . code === PostgresDuplicateObjectError
880
- ) {
881
- // Table already exists, must have been created by a different request. Ignore error.
882
- } else {
883
- throw error ;
884
- }
876
+ throw error ;
885
877
} ) ;
886
878
}
887
879
@@ -2422,23 +2414,7 @@ export class PostgresStorageAdapter implements StorageAdapter {
2422
2414
}
2423
2415
await conn.none(qs, [indexNameOptions.name, className, ...fieldNames])
2424
2416
.catch(error => {
2425
- if (
2426
- error.code === PostgresDuplicateRelationError &&
2427
- error.message.includes(indexNameOptions.name)
2428
- ) {
2429
- // Index already exists. Ignore error.
2430
- } else if (
2431
- error.code === PostgresUniqueIndexViolationError &&
2432
- error.message.includes(indexNameOptions.name)
2433
- ) {
2434
- // Cast the error into the proper parse error
2435
- throw new Parse.Error(
2436
- Parse.Error.DUPLICATE_VALUE,
2437
- 'A duplicate value for a field with unique values was provided'
2438
- );
2439
- } else {
2440
- throw error;
2441
- }
2417
+ throw error;
2442
2418
});
2443
2419
}
2444
2420
@@ -2463,15 +2439,7 @@ export class PostgresStorageAdapter implements StorageAdapter {
2463
2439
return conn
2464
2440
.none(qs, [ttlOptions])
2465
2441
.catch(error => {
2466
- if (
2467
- error.code === PostgresDuplicateRelationError ||
2468
- error.code === PostgresUniqueIndexViolationError ||
2469
- error.code === PostgresDuplicateObjectError
2470
- ) {
2471
- // Function already exists, must have been created by a different request. Ignore error.
2472
- } else {
2473
- throw error;
2474
- }
2442
+ throw error;
2475
2443
});
2476
2444
}
2477
2445
}
0 commit comments