linagora / james-project

Mirror of Apache James Project
Apache License 2.0
70 stars 63 forks source link

[Postgres] Reworking AttachmentID #5127

Closed hungphan227 closed 4 months ago

hungphan227 commented 4 months ago

Why

ID in attachment table should be UUID? (https://github.com/apache/james-project/pull/2108/commits/19caaf72ff47904e2427b2a8f7fefb11221102f6)

How

hungphan227 commented 4 months ago
public static AttachmentId random() {
        return new AttachmentId(RANDOM_STRING_GENERATOR.generate(20));
    } 

@chibenwa IMO 20 characters is not big. Is it necessary to use UUID?

chibenwa commented 4 months ago

It's not only a question of space but also of efficiency... Let me have a look.

chibenwa commented 4 months ago

The biggest issue I faced when trying to "drop" the use of String in favor of UUID in existing code - namely CassandraMessageDAOV3.

chibenwa commented 4 months ago

Yet, I would still prefer a clean use of UUID please

hungphan227 commented 4 months ago

pr for master branch https://github.com/apache/james-project/pull/2133

hungphan227 commented 4 months ago

pr for postgresql branch https://github.com/apache/james-project/pull/2142

hungphan227 commented 4 months ago

unbind AttachmentBlobResolver in master branch https://github.com/apache/james-project/pull/2150