60 lines
1.5 KiB
JavaScript
60 lines
1.5 KiB
JavaScript
|
|
/// <reference path="../pb_data/types.d.ts" />
|
||
|
|
migrate((db) => {
|
||
|
|
const collection = new Collection({
|
||
|
|
"id": "b7dbz8i2snrgw9g",
|
||
|
|
"created": "2026-04-17 12:37:35.573Z",
|
||
|
|
"updated": "2026-04-17 12:37:35.573Z",
|
||
|
|
"name": "game_favorites",
|
||
|
|
"type": "base",
|
||
|
|
"system": false,
|
||
|
|
"schema": [
|
||
|
|
{
|
||
|
|
"system": false,
|
||
|
|
"id": "gf_game",
|
||
|
|
"name": "game",
|
||
|
|
"type": "relation",
|
||
|
|
"required": true,
|
||
|
|
"presentable": false,
|
||
|
|
"unique": false,
|
||
|
|
"options": {
|
||
|
|
"collectionId": "x5adjlc0txf16r8",
|
||
|
|
"cascadeDelete": false,
|
||
|
|
"minSelect": null,
|
||
|
|
"maxSelect": 1,
|
||
|
|
"displayFields": null
|
||
|
|
}
|
||
|
|
},
|
||
|
|
{
|
||
|
|
"system": false,
|
||
|
|
"id": "gf_user",
|
||
|
|
"name": "user",
|
||
|
|
"type": "relation",
|
||
|
|
"required": true,
|
||
|
|
"presentable": false,
|
||
|
|
"unique": false,
|
||
|
|
"options": {
|
||
|
|
"collectionId": "_pb_users_auth_",
|
||
|
|
"cascadeDelete": false,
|
||
|
|
"minSelect": null,
|
||
|
|
"maxSelect": 1,
|
||
|
|
"displayFields": null
|
||
|
|
}
|
||
|
|
}
|
||
|
|
],
|
||
|
|
"indexes": [],
|
||
|
|
"listRule": "@request.auth.id != \"\"",
|
||
|
|
"viewRule": "@request.auth.id != \"\"",
|
||
|
|
"createRule": "@request.auth.id != \"\"",
|
||
|
|
"updateRule": null,
|
||
|
|
"deleteRule": "user = @request.auth.id",
|
||
|
|
"options": {}
|
||
|
|
});
|
||
|
|
|
||
|
|
return Dao(db).saveCollection(collection);
|
||
|
|
}, (db) => {
|
||
|
|
const dao = new Dao(db);
|
||
|
|
const collection = dao.findCollectionByNameOrId("b7dbz8i2snrgw9g");
|
||
|
|
|
||
|
|
return dao.deleteCollection(collection);
|
||
|
|
})
|