silvester-23/pb_migrations/1699787376_updated_invites.js
2023-11-12 17:33:15 +01:00

53 lines
1.1 KiB
JavaScript

/// <reference path="../pb_data/types.d.ts" />
migrate((db) => {
const dao = new Dao(db)
const collection = dao.findCollectionByNameOrId("zfbbb4gbdk9dh6k")
// remove
collection.schema.removeField("rdxgmjz0")
// add
collection.schema.addField(new SchemaField({
"system": false,
"id": "artkpdru",
"name": "portrait",
"type": "file",
"required": false,
"presentable": false,
"unique": false,
"options": {
"maxSelect": 1,
"maxSize": 5242880,
"mimeTypes": [],
"thumbs": [],
"protected": false
}
}))
return dao.saveCollection(collection)
}, (db) => {
const dao = new Dao(db)
const collection = dao.findCollectionByNameOrId("zfbbb4gbdk9dh6k")
// add
collection.schema.addField(new SchemaField({
"system": false,
"id": "rdxgmjz0",
"name": "portrait_url",
"type": "text",
"required": false,
"presentable": false,
"unique": false,
"options": {
"min": null,
"max": null,
"pattern": ""
}
}))
// remove
collection.schema.removeField("artkpdru")
return dao.saveCollection(collection)
})