This repository has been archived on 2025-10-01. You can view files and clone it. You cannot open issues or pull requests or push a commit.
Files
garands-world-game-archived/pocketbase/pb_migrations/1731451954_updated_provinces.js

53 lines
1.1 KiB
JavaScript

/// <reference path="../pb_data/types.d.ts" />
migrate((db) => {
const dao = new Dao(db)
const collection = dao.findCollectionByNameOrId("gzjx76q8fu9nqby")
// remove
collection.schema.removeField("i9nbkkcw")
// add
collection.schema.addField(new SchemaField({
"system": false,
"id": "6fotsmab",
"name": "capital",
"type": "text",
"required": false,
"presentable": false,
"unique": false,
"options": {
"min": null,
"max": null,
"pattern": ""
}
}))
return dao.saveCollection(collection)
}, (db) => {
const dao = new Dao(db)
const collection = dao.findCollectionByNameOrId("gzjx76q8fu9nqby")
// add
collection.schema.addField(new SchemaField({
"system": false,
"id": "i9nbkkcw",
"name": "capital",
"type": "relation",
"required": false,
"presentable": false,
"unique": false,
"options": {
"collectionId": "qeo77u83ue36ptc",
"cascadeDelete": false,
"minSelect": null,
"maxSelect": 1,
"displayFields": null
}
}))
// remove
collection.schema.removeField("6fotsmab")
return dao.saveCollection(collection)
})