Files
hudozka/pb/pb_migrations/1775426623_updated_images.js
T
2026-04-12 19:13:24 +03:00

42 lines
904 B
JavaScript

/// <reference path="../pb_data/types.d.ts" />
migrate((app) => {
const collection = app.findCollectionByNameOrId("pbc_3607937828")
// update collection data
unmarshal({
"indexes": [
"CREATE UNIQUE INDEX `idx_i7TNFDMzt9` ON `images` (`sha256`)"
]
}, collection)
// add field
collection.fields.addAt(8, new Field({
"autogeneratePattern": "",
"hidden": false,
"id": "text1556616439",
"max": 0,
"min": 0,
"name": "sha256",
"pattern": "",
"presentable": false,
"primaryKey": false,
"required": false,
"system": false,
"type": "text"
}))
return app.save(collection)
}, (app) => {
const collection = app.findCollectionByNameOrId("pbc_3607937828")
// update collection data
unmarshal({
"indexes": []
}, collection)
// remove field
collection.fields.removeById("text1556616439")
return app.save(collection)
})