Files
gamegroup2/backend/pb_migrations/1776760462_updated_groups.js
T
congsh 2fec2108ca feat: onboarding optimization, invite links, admin roles, and event board
- Home: hide duplicate create/join buttons when user has no groups
- Invite links: /join/group/:id and /join/team/:id pages for one-click joining
- Admin: group admins field, ownership transfer, member management toggle
- Events: new events collection with RSVP (going/interested/maybe) and comments

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-21 17:27:24 +08:00

46 lines
1.1 KiB
JavaScript

/// <reference path="../pb_data/types.d.ts" />
migrate((db) => {
const dao = new Dao(db)
const collection = dao.findCollectionByNameOrId("es63bkyiblpnxdf")
// add admins field
collection.schema.addField(new SchemaField({
"system": false,
"id": "sf_admins",
"name": "admins",
"type": "relation",
"required": false,
"presentable": false,
"unique": false,
"options": {
"collectionId": "_pb_users_auth_",
"cascadeDelete": false,
"minSelect": null,
"maxSelect": null,
"displayFields": null
}
}))
// add allowMemberManage field
collection.schema.addField(new SchemaField({
"system": false,
"id": "sf_allowmm",
"name": "allowMemberManage",
"type": "bool",
"required": false,
"presentable": false,
"unique": false,
"options": {}
}))
return dao.saveCollection(collection)
}, (db) => {
const dao = new Dao(db)
const collection = dao.findCollectionByNameOrId("es63bkyiblpnxdf")
collection.schema.removeField("sf_admins")
collection.schema.removeField("sf_allowmm")
return dao.saveCollection(collection)
})