Files
gitlab-instance-0a899031_no…/pb_migrations/1760666168_updated_file.js
eric 334fdbfe42 s
2025-10-17 02:02:13 +00:00

141 lines
3.1 KiB
JavaScript

/// <reference path="../pb_data/types.d.ts" />
migrate((app) => {
const collection = app.findCollectionByNameOrId("pbc_2878493088")
// update field
collection.fields.addAt(1, new Field({
"hidden": false,
"id": "file3309110367",
"maxSelect": 99,
"maxSize": 0,
"mimeTypes": [
"image/jpeg",
"image/png",
"image/svg+xml",
"image/gif",
"image/webp"
],
"name": "images",
"presentable": false,
"protected": false,
"required": false,
"system": false,
"thumbs": [],
"type": "file"
}))
// update field
collection.fields.addAt(2, new Field({
"hidden": false,
"id": "file2359244304",
"maxSelect": 99,
"maxSize": 0,
"mimeTypes": [
"application/pdf",
"application/msword",
"application/vnd.openxmlformats-officedocument.wordprocessingml.document",
"application/vnd.ms-excel",
"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"
],
"name": "files",
"presentable": false,
"protected": false,
"required": false,
"system": false,
"thumbs": [],
"type": "file"
}))
// update field
collection.fields.addAt(3, new Field({
"hidden": false,
"id": "file2093472300",
"maxSelect": 99,
"maxSize": 0,
"mimeTypes": [
"video/mp4",
"video/x-ms-wmv",
"video/quicktime",
"video/3gpp"
],
"name": "videos",
"presentable": false,
"protected": false,
"required": false,
"system": false,
"thumbs": [],
"type": "file"
}))
return app.save(collection)
}, (app) => {
const collection = app.findCollectionByNameOrId("pbc_2878493088")
// update field
collection.fields.addAt(1, new Field({
"hidden": false,
"id": "file3309110367",
"maxSelect": 99,
"maxSize": 0,
"mimeTypes": [
"image/jpeg",
"image/png",
"image/svg+xml",
"image/gif",
"image/webp"
],
"name": "image",
"presentable": false,
"protected": false,
"required": false,
"system": false,
"thumbs": [],
"type": "file"
}))
// update field
collection.fields.addAt(2, new Field({
"hidden": false,
"id": "file2359244304",
"maxSelect": 99,
"maxSize": 0,
"mimeTypes": [
"application/pdf",
"application/msword",
"application/vnd.openxmlformats-officedocument.wordprocessingml.document",
"application/vnd.ms-excel",
"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"
],
"name": "file",
"presentable": false,
"protected": false,
"required": false,
"system": false,
"thumbs": [],
"type": "file"
}))
// update field
collection.fields.addAt(3, new Field({
"hidden": false,
"id": "file2093472300",
"maxSelect": 99,
"maxSize": 0,
"mimeTypes": [
"video/mp4",
"video/x-ms-wmv",
"video/quicktime",
"video/3gpp"
],
"name": "video",
"presentable": false,
"protected": false,
"required": false,
"system": false,
"thumbs": [],
"type": "file"
}))
return app.save(collection)
})