This repository has been archived on 2025-12-01. You can view files and clone it. You cannot open issues or pull requests or push a commit.
Files
BreadnetV3/pb/pb_migrations/1730870006_updated_posts.js
2025-11-13 23:45:26 +13:00

141 lines
2.7 KiB
JavaScript

/// <reference path="../pb_data/types.d.ts" />
migrate((db) => {
const dao = new Dao(db)
const collection = dao.findCollectionByNameOrId("jbzxvie5c27b6od")
// update
collection.schema.addField(new SchemaField({
"system": false,
"id": "ecgjqmlq",
"name": "tags",
"type": "select",
"required": false,
"presentable": false,
"unique": false,
"options": {
"maxSelect": 5,
"values": [
"games",
"stuff",
"tv",
"tech",
"music"
]
}
}))
// update
collection.schema.addField(new SchemaField({
"system": false,
"id": "vbyoyeqa",
"name": "slug",
"type": "text",
"required": true,
"presentable": false,
"unique": false,
"options": {
"min": null,
"max": null,
"pattern": ""
}
}))
// update
collection.schema.addField(new SchemaField({
"system": false,
"id": "xdfhvrti",
"name": "media",
"type": "file",
"required": false,
"presentable": false,
"unique": false,
"options": {
"mimeTypes": [
"image/png",
"image/vnd.mozilla.apng",
"image/jpeg",
"image/jxl",
"image/gif",
"image/jxr",
"audio/mpeg",
"video/mp4",
"video/webm",
"audio/mp4"
],
"thumbs": [],
"maxSelect": 99,
"maxSize": 5242880,
"protected": false
}
}))
return dao.saveCollection(collection)
}, (db) => {
const dao = new Dao(db)
const collection = dao.findCollectionByNameOrId("jbzxvie5c27b6od")
// update
collection.schema.addField(new SchemaField({
"system": false,
"id": "ecgjqmlq",
"name": "tags",
"type": "select",
"required": false,
"presentable": false,
"unique": false,
"options": {
"maxSelect": 2,
"values": [
"games",
"stuff",
"tv",
"tech",
"music"
]
}
}))
// update
collection.schema.addField(new SchemaField({
"system": false,
"id": "vbyoyeqa",
"name": "slug",
"type": "text",
"required": false,
"presentable": false,
"unique": false,
"options": {
"min": null,
"max": null,
"pattern": ""
}
}))
// update
collection.schema.addField(new SchemaField({
"system": false,
"id": "xdfhvrti",
"name": "media",
"type": "file",
"required": false,
"presentable": false,
"unique": false,
"options": {
"mimeTypes": [
"image/png",
"image/vnd.mozilla.apng",
"image/jpeg",
"image/jxl",
"image/gif",
"image/jxr"
],
"thumbs": [],
"maxSelect": 99,
"maxSize": 5242880,
"protected": false
}
}))
return dao.saveCollection(collection)
})