Add existing PB migrations

This commit is contained in:
2025-11-13 23:45:26 +13:00
parent 4c4ca3ed96
commit c07c0550c0
31 changed files with 1635 additions and 1 deletions

View File

@@ -0,0 +1,31 @@
/// <reference path="../pb_data/types.d.ts" />
migrate((db) => {
const dao = new Dao(db)
const collection = dao.findCollectionByNameOrId("my9ej2vdwzwoqov")
// add
collection.schema.addField(new SchemaField({
"system": false,
"id": "x9ytobkp",
"name": "alt",
"type": "text",
"required": true,
"presentable": false,
"unique": false,
"options": {
"min": null,
"max": null,
"pattern": ""
}
}))
return dao.saveCollection(collection)
}, (db) => {
const dao = new Dao(db)
const collection = dao.findCollectionByNameOrId("my9ej2vdwzwoqov")
// remove
collection.schema.removeField("x9ytobkp")
return dao.saveCollection(collection)
})