pocketbase/pb_migrations/1730279343_updated_feedback.js

51 lines
1.1 KiB
JavaScript
Executable File

/// <reference path="../pb_data/types.d.ts" />
migrate((db) => {
const dao = new Dao(db)
const collection = dao.findCollectionByNameOrId("t34cnoela3e63ux")
// remove
collection.schema.removeField("jpvcv0r9")
// add
collection.schema.addField(new SchemaField({
"system": false,
"id": "xvqwzmmt",
"name": "emoji_rating",
"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("t34cnoela3e63ux")
// add
collection.schema.addField(new SchemaField({
"system": false,
"id": "jpvcv0r9",
"name": "emoji_rating",
"type": "number",
"required": false,
"presentable": false,
"unique": false,
"options": {
"min": null,
"max": null,
"noDecimal": false
}
}))
// remove
collection.schema.removeField("xvqwzmmt")
return dao.saveCollection(collection)
})