You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -35,6 +36,91 @@ A powerful and flexible NestJS module for integrating MinIO object storage into
35
36
- 🔄 RxJS integration
36
37
- 🧩 Optional `@nestjs/mongoose` integration (only required if you use `@FileSchemaField`)
37
38
- 🤖 Automatic presigned URL detection even for raw QueryBuilder results
39
+
- 🔒 Explicit `minio://` prefix format for safe URL transformation
40
+
41
+
## Migration Guide (v1.x → v2.0.0)
42
+
43
+
### ⚠️ Breaking Changes
44
+
45
+
**File Path Format Change**: Starting from v2.0.0, all file paths are stored in `minio://bucket-name/file-path` format instead of `bucket-name/file-path`.
46
+
47
+
#### What Changed?
48
+
49
+
-`uploadFile()` now returns `minio://bucket/file` format
50
+
- Only strings starting with `minio://` are automatically transformed to presigned URLs
51
+
- This prevents accidental transformation of other URLs (like `otpauth://`, `http://`, `https://`, etc.)
52
+
- Removed backward compatibility with `bucket/file` format
53
+
54
+
#### Why This Change?
55
+
56
+
The previous version had an issue where any string containing a `/` character could be incorrectly identified as a MinIO path, causing unwanted URL transformations. For example, OTP URLs like `otpauth://totp/NodeLink:user?secret=...` were being incorrectly transformed.
57
+
58
+
The new `minio://` prefix ensures:
59
+
- ✅ **Explicit identification**: Only intentionally marked file paths are transformed
60
+
- ✅ **Safety**: Other URLs remain untouched
61
+
- ✅ **Clarity**: Developers can clearly see which fields are MinIO file references
62
+
63
+
#### Migration Steps
64
+
65
+
1.**Update your database**: Migrate existing file paths from `bucket/file` to `minio://bucket/file`
66
+
67
+
```sql
68
+
-- Example SQL migration (adjust for your database)
69
+
-- PostgreSQL
70
+
UPDATE users SET avatar = CONCAT('minio://', avatar) WHERE avatar NOT LIKE'minio://%'AND avatar LIKE'%/%';
71
+
72
+
-- MySQL
73
+
UPDATE users SET avatar = CONCAT('minio://', avatar) WHERE avatar NOT LIKE'minio://%'AND avatar LIKE'%/%';
0 commit comments