Add existing PB migrations
This commit is contained in:
33
pb/pb_migrations/1731579887_updated_posts_media.js
Normal file
33
pb/pb_migrations/1731579887_updated_posts_media.js
Normal file
@@ -0,0 +1,33 @@
|
||||
/// <reference path="../pb_data/types.d.ts" />
|
||||
migrate((db) => {
|
||||
const dao = new Dao(db)
|
||||
const collection = dao.findCollectionByNameOrId("eys4l76rqwkloyf")
|
||||
|
||||
// remove
|
||||
collection.schema.removeField("yfxer1xb")
|
||||
|
||||
return dao.saveCollection(collection)
|
||||
}, (db) => {
|
||||
const dao = new Dao(db)
|
||||
const collection = dao.findCollectionByNameOrId("eys4l76rqwkloyf")
|
||||
|
||||
// add
|
||||
collection.schema.addField(new SchemaField({
|
||||
"system": false,
|
||||
"id": "yfxer1xb",
|
||||
"name": "og_post",
|
||||
"type": "relation",
|
||||
"required": false,
|
||||
"presentable": false,
|
||||
"unique": false,
|
||||
"options": {
|
||||
"collectionId": "jbzxvie5c27b6od",
|
||||
"cascadeDelete": false,
|
||||
"minSelect": null,
|
||||
"maxSelect": 1,
|
||||
"displayFields": null
|
||||
}
|
||||
}))
|
||||
|
||||
return dao.saveCollection(collection)
|
||||
})
|
||||
Reference in New Issue
Block a user