Add existing PB migrations
This commit is contained in:
140
pb/pb_migrations/1730870006_updated_posts.js
Normal file
140
pb/pb_migrations/1730870006_updated_posts.js
Normal file
@@ -0,0 +1,140 @@
|
||||
/// <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)
|
||||
})
|
||||
Reference in New Issue
Block a user