f99c44f716
- Add bulletin_posts and bulletin_reads PocketBase collections with migrations - Add BulletinPost/BulletinRead types and priority levels (low/normal/high/urgent) - Add bulletin API (CRUD, read tracking, realtime subscription) - Add bulletin Pinia store with pinned/normal sections and expiration filtering - Add BulletinPinned header component for pinned announcements - Add BulletinBoard tab component with sectioned list layout - Add BulletinPostCard with priority tags, unread dots, and hover actions - Add CreateBulletinDialog with title, content, priority, pinned, expiresAt - Integrate bulletin tab into GroupView with Bell icon and real-time updates Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
61 lines
1.7 KiB
JavaScript
61 lines
1.7 KiB
JavaScript
/// <reference path="../pb_data/types.d.ts" />
|
|
migrate((db) => {
|
|
const collection = new Collection({
|
|
"id": "bulletin_reads",
|
|
"created": "2026-04-21 00:00:01.000Z",
|
|
"updated": "2026-04-21 00:00:01.000Z",
|
|
"name": "bulletin_reads",
|
|
"type": "base",
|
|
"system": false,
|
|
"schema": [
|
|
{
|
|
"system": false,
|
|
"id": "br_post",
|
|
"name": "post",
|
|
"type": "relation",
|
|
"required": true,
|
|
"presentable": false,
|
|
"unique": false,
|
|
"options": {
|
|
"collectionId": "bulletin_posts",
|
|
"cascadeDelete": true,
|
|
"minSelect": null,
|
|
"maxSelect": 1,
|
|
"displayFields": null
|
|
}
|
|
},
|
|
{
|
|
"system": false,
|
|
"id": "br_user",
|
|
"name": "user",
|
|
"type": "relation",
|
|
"required": true,
|
|
"presentable": false,
|
|
"unique": false,
|
|
"options": {
|
|
"collectionId": "_pb_users_auth_",
|
|
"cascadeDelete": true,
|
|
"minSelect": null,
|
|
"maxSelect": 1,
|
|
"displayFields": null
|
|
}
|
|
}
|
|
],
|
|
"indexes": [
|
|
"CREATE UNIQUE INDEX `idx_bulletin_reads_post_user` ON `bulletin_reads` (\n `post`,\n `user`\n)"
|
|
],
|
|
"listRule": "@request.auth.id != \"\" && user = @request.auth.id",
|
|
"viewRule": "@request.auth.id != \"\" && user = @request.auth.id",
|
|
"createRule": "@request.auth.id != \"\" && user = @request.auth.id",
|
|
"updateRule": null,
|
|
"deleteRule": "user = @request.auth.id || post.group.owner = @request.auth.id",
|
|
"options": {}
|
|
});
|
|
|
|
return Dao(db).saveCollection(collection);
|
|
}, (db) => {
|
|
const dao = new Dao(db);
|
|
const collection = dao.findCollectionByNameOrId("bulletin_reads");
|
|
return dao.deleteCollection(collection);
|
|
})
|