Add pocketbase migrations

This commit is contained in:
Niklas Korz 2023-12-08 21:34:16 +01:00
parent c75003f5f0
commit 0d330c4f60
13 changed files with 547 additions and 0 deletions

View file

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