diff --git a/backend/pb_migrations/1754500100_users_avatar_maxsize.js b/backend/pb_migrations/1754500100_users_avatar_maxsize.js new file mode 100644 index 0000000..1695b3d --- /dev/null +++ b/backend/pb_migrations/1754500100_users_avatar_maxsize.js @@ -0,0 +1,17 @@ +/// + +// Das Avatar-Feld stand auf maxSize 0 — also unbegrenzt. Das ist ein +// Ressourcenrisiko: Ein einzelner Upload könnte beliebig groß sein. +// Zurück auf die ursprünglichen 5 MB. + +migrate((app) => { + const users = app.findCollectionByNameOrId('users') + const avatar = users.fields.getByName('avatar') + avatar.maxSize = 5242880 + app.save(users) +}, (app) => { + const users = app.findCollectionByNameOrId('users') + const avatar = users.fields.getByName('avatar') + avatar.maxSize = 0 + app.save(users) +})