mirror of
https://github.com/signalapp/Signal-Server.git
synced 2026-12-01 12:46:47 +00:00
Include ATTR_MIGRATION_VERSION in update()
This commit is contained in:
1 parent
53e6f419b6
commit
abafa2ccac
2 files changed
+15
-4
No files matched your search
+5
-3
@@ -177,11 +177,13 @@ public class AccountsDynamoDb extends AbstractDynamoDbStore implements AccountSt
|
||||
updateItemRequest = new UpdateItemRequest()
|
||||
.withTableName(accountsTable.getTableName())
|
||||
.withKey(Map.of(KEY_ACCOUNT_UUID, new AttributeValue().withB(UUIDUtil.toByteBuffer(account.getUuid()))))
|
||||
.withUpdateExpression("SET #data=:data")
|
||||
.withUpdateExpression("SET #data = :data, #version = :version")
|
||||
.withConditionExpression("attribute_exists(#number)")
|
||||
.withExpressionAttributeNames(Map.of("#number", ATTR_ACCOUNT_E164,
|
||||
"#data", ATTR_ACCOUNT_DATA))
|
||||
.withExpressionAttributeValues(Map.of(":data", new AttributeValue().withB(ByteBuffer.wrap(SystemMapper.getMapper().writeValueAsBytes(account)))));
|
||||
"#data", ATTR_ACCOUNT_DATA,
|
||||
"#version", ATTR_MIGRATION_VERSION))
|
||||
.withExpressionAttributeValues(Map.of(":data", new AttributeValue().withB(ByteBuffer.wrap(SystemMapper.getMapper().writeValueAsBytes(account))),
|
||||
":version", new AttributeValue().withN(String.valueOf(account.getDynamoDbMigrationVersion()))));
|
||||
|
||||
} catch (JsonProcessingException e) {
|
||||
throw new IllegalArgumentException(e);
|
||||
|
||||
Reference in new issue
Block a user