89 lines
2.1 KiB
JavaScript
89 lines
2.1 KiB
JavaScript
|
|
/// <reference path="../pb_data/types.d.ts" />
|
||
|
|
migrate((db) => {
|
||
|
|
const collection = new Collection({
|
||
|
|
"id": "h5adxdw9gm0aw8s",
|
||
|
|
"created": "2026-04-18 09:12:14.095Z",
|
||
|
|
"updated": "2026-04-18 09:12:14.095Z",
|
||
|
|
"name": "point_logs",
|
||
|
|
"type": "base",
|
||
|
|
"system": false,
|
||
|
|
"schema": [
|
||
|
|
{
|
||
|
|
"system": false,
|
||
|
|
"id": "xeqacyc7",
|
||
|
|
"name": "user",
|
||
|
|
"type": "relation",
|
||
|
|
"required": true,
|
||
|
|
"presentable": false,
|
||
|
|
"unique": false,
|
||
|
|
"options": {
|
||
|
|
"collectionId": "_pb_users_auth_",
|
||
|
|
"cascadeDelete": true,
|
||
|
|
"minSelect": null,
|
||
|
|
"maxSelect": 1,
|
||
|
|
"displayFields": null
|
||
|
|
}
|
||
|
|
},
|
||
|
|
{
|
||
|
|
"system": false,
|
||
|
|
"id": "sd27cbh8",
|
||
|
|
"name": "action",
|
||
|
|
"type": "select",
|
||
|
|
"required": true,
|
||
|
|
"presentable": false,
|
||
|
|
"unique": false,
|
||
|
|
"options": {
|
||
|
|
"maxSelect": 1,
|
||
|
|
"values": [
|
||
|
|
"vote",
|
||
|
|
"team",
|
||
|
|
"memory"
|
||
|
|
]
|
||
|
|
}
|
||
|
|
},
|
||
|
|
{
|
||
|
|
"system": false,
|
||
|
|
"id": "iszqa13h",
|
||
|
|
"name": "points",
|
||
|
|
"type": "number",
|
||
|
|
"required": true,
|
||
|
|
"presentable": false,
|
||
|
|
"unique": false,
|
||
|
|
"options": {
|
||
|
|
"min": 1,
|
||
|
|
"max": null,
|
||
|
|
"noDecimal": false
|
||
|
|
}
|
||
|
|
},
|
||
|
|
{
|
||
|
|
"system": false,
|
||
|
|
"id": "pnipfzbd",
|
||
|
|
"name": "relatedId",
|
||
|
|
"type": "text",
|
||
|
|
"required": true,
|
||
|
|
"presentable": false,
|
||
|
|
"unique": false,
|
||
|
|
"options": {
|
||
|
|
"min": null,
|
||
|
|
"max": null,
|
||
|
|
"pattern": ""
|
||
|
|
}
|
||
|
|
}
|
||
|
|
],
|
||
|
|
"indexes": [],
|
||
|
|
"listRule": "user = @request.auth.id",
|
||
|
|
"viewRule": "user = @request.auth.id",
|
||
|
|
"createRule": "@request.auth.id != \"\" && user = @request.auth.id",
|
||
|
|
"updateRule": null,
|
||
|
|
"deleteRule": null,
|
||
|
|
"options": {}
|
||
|
|
});
|
||
|
|
|
||
|
|
return Dao(db).saveCollection(collection);
|
||
|
|
}, (db) => {
|
||
|
|
const dao = new Dao(db);
|
||
|
|
const collection = dao.findCollectionByNameOrId("h5adxdw9gm0aw8s");
|
||
|
|
|
||
|
|
return dao.deleteCollection(collection);
|
||
|
|
})
|