feat: game cover file upload + fix game visibility rules

- Change game cover field from URL text to file upload (PocketBase migration)
- AddGameDialog now supports drag-and-drop image upload instead of URL input
- Add getGameCoverUrl() helper using pb.files.getUrl() for cover display
- Fix games listRule/viewRule: group.members.id syntax doesn't work in PB 0.22,
  changed to group.members ~ @request.auth.id for correct member visibility
- Update changelog with all v0.3.5 entries

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
congsh
2026-04-23 19:09:57 +08:00
parent 625645dad4
commit ceafc873c7
8 changed files with 130 additions and 23 deletions
@@ -0,0 +1,51 @@
/// <reference path="../pb_data/types.d.ts" />
migrate((db) => {
const dao = new Dao(db)
const collection = dao.findCollectionByNameOrId("x5adjlc0txf16r8")
// remove old url cover field
collection.schema.removeField("cover_field")
// add new file cover field
collection.schema.addField(new SchemaField({
"system": false,
"id": "cover_file",
"name": "cover",
"type": "file",
"required": false,
"presentable": false,
"unique": false,
"options": {
"maxSelect": 1,
"maxSize": 5242880,
"mimeTypes": ["image/jpeg","image/png","image/gif","image/webp","image/svg+xml"],
"thumbs": null,
"protected": false
}
}))
return dao.saveCollection(collection)
}, (db) => {
const dao = new Dao(db)
const collection = dao.findCollectionByNameOrId("x5adjlc0txf16r8")
// remove file cover field
collection.schema.removeField("cover_file")
// restore url cover field
collection.schema.addField(new SchemaField({
"system": false,
"id": "cover_field",
"name": "cover",
"type": "url",
"required": false,
"presentable": false,
"unique": false,
"options": {
"exceptDomains": null,
"onlyDomains": null
}
}))
return dao.saveCollection(collection)
})