88 lines
2.1 KiB
JavaScript
88 lines
2.1 KiB
JavaScript
|
|
/// <reference path="../pb_data/types.d.ts" />
|
||
|
|
migrate((db) => {
|
||
|
|
const collection = new Collection({
|
||
|
|
"id": "4f73q31qelxycnu",
|
||
|
|
"created": "2026-04-17 12:37:24.610Z",
|
||
|
|
"updated": "2026-04-17 12:37:24.610Z",
|
||
|
|
"name": "game_comments",
|
||
|
|
"type": "base",
|
||
|
|
"system": false,
|
||
|
|
"schema": [
|
||
|
|
{
|
||
|
|
"system": false,
|
||
|
|
"id": "gc_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": "gc_author",
|
||
|
|
"name": "author",
|
||
|
|
"type": "relation",
|
||
|
|
"required": true,
|
||
|
|
"presentable": false,
|
||
|
|
"unique": false,
|
||
|
|
"options": {
|
||
|
|
"collectionId": "_pb_users_auth_",
|
||
|
|
"cascadeDelete": false,
|
||
|
|
"minSelect": null,
|
||
|
|
"maxSelect": 1,
|
||
|
|
"displayFields": null
|
||
|
|
}
|
||
|
|
},
|
||
|
|
{
|
||
|
|
"system": false,
|
||
|
|
"id": "gc_content",
|
||
|
|
"name": "content",
|
||
|
|
"type": "text",
|
||
|
|
"required": true,
|
||
|
|
"presentable": false,
|
||
|
|
"unique": false,
|
||
|
|
"options": {
|
||
|
|
"min": null,
|
||
|
|
"max": 1000,
|
||
|
|
"pattern": ""
|
||
|
|
}
|
||
|
|
},
|
||
|
|
{
|
||
|
|
"system": false,
|
||
|
|
"id": "gc_rating",
|
||
|
|
"name": "rating",
|
||
|
|
"type": "number",
|
||
|
|
"required": false,
|
||
|
|
"presentable": false,
|
||
|
|
"unique": false,
|
||
|
|
"options": {
|
||
|
|
"min": 1,
|
||
|
|
"max": 5,
|
||
|
|
"noDecimal": true
|
||
|
|
}
|
||
|
|
}
|
||
|
|
],
|
||
|
|
"indexes": [],
|
||
|
|
"listRule": "@request.auth.id != \"\"",
|
||
|
|
"viewRule": "@request.auth.id != \"\"",
|
||
|
|
"createRule": "@request.auth.id != \"\"",
|
||
|
|
"updateRule": null,
|
||
|
|
"deleteRule": "author = @request.auth.id",
|
||
|
|
"options": {}
|
||
|
|
});
|
||
|
|
|
||
|
|
return Dao(db).saveCollection(collection);
|
||
|
|
}, (db) => {
|
||
|
|
const dao = new Dao(db);
|
||
|
|
const collection = dao.findCollectionByNameOrId("4f73q31qelxycnu");
|
||
|
|
|
||
|
|
return dao.deleteCollection(collection);
|
||
|
|
})
|