astro_minivan/backend/pb_migrations/1765697155_updated_slider_cars.js

228 lines
4.7 KiB
JavaScript
Raw Normal View History

2026-03-29 17:24:16 +05:00
/// <reference path="../pb_data/types.d.ts" />
migrate((app) => {
const collection = app.findCollectionByNameOrId("pbc_44601008")
// add field
collection.fields.addAt(3, new Field({
"hidden": false,
"id": "number3145888567",
"max": null,
"min": null,
"name": "year",
"onlyInt": false,
"presentable": false,
"required": false,
"system": false,
"type": "number"
}))
// add field
collection.fields.addAt(4, new Field({
"autogeneratePattern": "",
"hidden": false,
"id": "text2751747720",
"max": 0,
"min": 0,
"name": "horsepower",
"pattern": "",
"presentable": false,
"primaryKey": false,
"required": false,
"system": false,
"type": "text"
}))
// add field
collection.fields.addAt(5, new Field({
"autogeneratePattern": "",
"hidden": false,
"id": "text3402113753",
"max": 0,
"min": 0,
"name": "price",
"pattern": "",
"presentable": false,
"primaryKey": false,
"required": false,
"system": false,
"type": "text"
}))
// add field
collection.fields.addAt(6, new Field({
"autogeneratePattern": "",
"hidden": false,
"id": "text992510796",
"max": 0,
"min": 0,
"name": "seats_count",
"pattern": "",
"presentable": false,
"primaryKey": false,
"required": false,
"system": false,
"type": "text"
}))
// add field
collection.fields.addAt(7, new Field({
"autogeneratePattern": "",
"hidden": false,
"id": "text2775191768",
"max": 0,
"min": 0,
"name": "doors_count",
"pattern": "",
"presentable": false,
"primaryKey": false,
"required": false,
"system": false,
"type": "text"
}))
// add field
collection.fields.addAt(8, new Field({
"autogeneratePattern": "",
"hidden": false,
"id": "text314431665",
"max": 0,
"min": 0,
"name": "trunk_capacity",
"pattern": "",
"presentable": false,
"primaryKey": false,
"required": false,
"system": false,
"type": "text"
}))
// add field
collection.fields.addAt(9, new Field({
"autogeneratePattern": "",
"hidden": false,
"id": "text1843675174",
"max": 0,
"min": 0,
"name": "description",
"pattern": "",
"presentable": false,
"primaryKey": false,
"required": false,
"system": false,
"type": "text"
}))
// add field
collection.fields.addAt(10, new Field({
"hidden": false,
"id": "file3309110367",
"maxSelect": 1,
"maxSize": 0,
"mimeTypes": [],
"name": "image",
"presentable": false,
"protected": false,
"required": false,
"system": false,
"thumbs": [],
"type": "file"
}))
// add field
collection.fields.addAt(11, new Field({
"autogeneratePattern": "",
"hidden": false,
"id": "text88749771",
"max": 0,
"min": 0,
"name": "alt_text",
"pattern": "",
"presentable": false,
"primaryKey": false,
"required": false,
"system": false,
"type": "text"
}))
// add field
collection.fields.addAt(12, new Field({
"hidden": false,
"id": "number4113142680",
"max": null,
"min": null,
"name": "order",
"onlyInt": false,
"presentable": false,
"required": false,
"system": false,
"type": "number"
}))
// add field
collection.fields.addAt(13, new Field({
"hidden": false,
"id": "bool458715613",
"name": "is_active",
"presentable": false,
"required": false,
"system": false,
"type": "bool"
}))
// add field
collection.fields.addAt(14, new Field({
"hidden": false,
"id": "number4028939642",
"max": null,
"min": null,
"name": "max_passengers",
"onlyInt": false,
"presentable": false,
"required": false,
"system": false,
"type": "number"
}))
return app.save(collection)
}, (app) => {
const collection = app.findCollectionByNameOrId("pbc_44601008")
// remove field
collection.fields.removeById("number3145888567")
// remove field
collection.fields.removeById("text2751747720")
// remove field
collection.fields.removeById("text3402113753")
// remove field
collection.fields.removeById("text992510796")
// remove field
collection.fields.removeById("text2775191768")
// remove field
collection.fields.removeById("text314431665")
// remove field
collection.fields.removeById("text1843675174")
// remove field
collection.fields.removeById("file3309110367")
// remove field
collection.fields.removeById("text88749771")
// remove field
collection.fields.removeById("number4113142680")
// remove field
collection.fields.removeById("bool458715613")
// remove field
collection.fields.removeById("number4028939642")
return app.save(collection)
})