Skip to content

Commit d37278a

Browse files
authored
Merge pull request #254 from supertokens/feat/bulk_migration_returns_userids
feat: bulk migration returns userids
2 parents feb0304 + b2721c5 commit d37278a

File tree

3 files changed

+11
-1
lines changed

3 files changed

+11
-1
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,10 @@ to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
77

88
## [Unreleased]
99

10+
## [8.1.1]
11+
12+
- Adds more null and empty checks for bulk migration
13+
1014
## [8.1.0]
1115

1216
- Adds support for webauthn (passkeys)

build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ plugins {
22
id 'java-library'
33
}
44

5-
version = "8.1.0"
5+
version = "8.1.1"
66

77
repositories {
88
mavenCentral()

src/main/java/io/supertokens/storage/postgresql/queries/BulkImportQueries.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,9 @@ public static String getQueryToCreatePaginationIndex2(Start start) {
7676

7777
public static void insertBulkImportUsers_Transaction(Start start, Connection connection, AppIdentifier appIdentifier, List<BulkImportUser> users)
7878
throws SQLException, StorageQueryException {
79+
if(users == null || users.isEmpty()){
80+
return;
81+
}
7982
String queryBuilder = "INSERT INTO " + Config.getConfig(start).getBulkImportUsersTable() +
8083
" (id, app_id, raw_data, created_at, updated_at) VALUES "
8184
+ " (?, ?, ?, ?, ?)";
@@ -118,6 +121,9 @@ public static void updateBulkImportUserStatus_Transaction(Start start, Connectio
118121
public static void updateMultipleBulkImportUsersStatusToError_Transaction(Start start, Connection con, AppIdentifier appIdentifier,
119122
@Nonnull Map<String,String> bulkImportUserIdToErrorMessage)
120123
throws SQLException, StorageQueryException {
124+
if(bulkImportUserIdToErrorMessage == null || bulkImportUserIdToErrorMessage.isEmpty()){
125+
return;
126+
}
121127
BULK_IMPORT_USER_STATUS errorStatus = BULK_IMPORT_USER_STATUS.FAILED;
122128
String query = "UPDATE " + Config.getConfig(start).getBulkImportUsersTable()
123129
+ " SET status = ?, error_msg = ?, updated_at = ? WHERE app_id = ? and id = ?";

0 commit comments

Comments
 (0)