Новые изменения в проекте

This commit is contained in:
Web-serfer 2026-04-20 20:27:04 +05:00
parent ecb720f751
commit ddc0a26635
13 changed files with 950 additions and 48 deletions

View file

@ -0,0 +1,22 @@
/// <reference path="../pb_data/types.d.ts" />
migrate((app) => {
const collection = app.findCollectionByNameOrId("pbc_4163081445")
// update collection data
unmarshal({
"listRule": "status = \"published\" ",
"viewRule": "status = \"published\" "
}, collection)
return app.save(collection)
}, (app) => {
const collection = app.findCollectionByNameOrId("pbc_4163081445")
// update collection data
unmarshal({
"listRule": "",
"viewRule": ""
}, collection)
return app.save(collection)
})

View file

@ -0,0 +1,20 @@
/// <reference path="../pb_data/types.d.ts" />
migrate((app) => {
const collection = app.findCollectionByNameOrId("pbc_4163081445")
// update collection data
unmarshal({
"createRule": "@request.auth.id != \"\""
}, collection)
return app.save(collection)
}, (app) => {
const collection = app.findCollectionByNameOrId("pbc_4163081445")
// update collection data
unmarshal({
"createRule": ""
}, collection)
return app.save(collection)
})

View file

@ -0,0 +1,20 @@
/// <reference path="../pb_data/types.d.ts" />
migrate((app) => {
const collection = app.findCollectionByNameOrId("pbc_4163081445")
// update collection data
unmarshal({
"updateRule": "user = @request.auth.id || @request.auth.id = \"admin_id\""
}, collection)
return app.save(collection)
}, (app) => {
const collection = app.findCollectionByNameOrId("pbc_4163081445")
// update collection data
unmarshal({
"updateRule": ""
}, collection)
return app.save(collection)
})

View file

@ -0,0 +1,20 @@
/// <reference path="../pb_data/types.d.ts" />
migrate((app) => {
const collection = app.findCollectionByNameOrId("pbc_4163081445")
// update collection data
unmarshal({
"deleteRule": "user = @request.auth.id || @request.auth.id = \"admin_id\" "
}, collection)
return app.save(collection)
}, (app) => {
const collection = app.findCollectionByNameOrId("pbc_4163081445")
// update collection data
unmarshal({
"deleteRule": null
}, collection)
return app.save(collection)
})

View file

@ -0,0 +1,57 @@
/// <reference path="../pb_data/types.d.ts" />
migrate((app) => {
const collection = new Collection({
"createRule": null,
"deleteRule": null,
"fields": [
{
"autogeneratePattern": "[a-z0-9]{15}",
"hidden": false,
"id": "text3208210256",
"max": 15,
"min": 15,
"name": "id",
"pattern": "^[a-z0-9]+$",
"presentable": false,
"primaryKey": true,
"required": true,
"system": true,
"type": "text"
},
{
"hidden": false,
"id": "autodate2990389176",
"name": "created",
"onCreate": true,
"onUpdate": false,
"presentable": false,
"system": false,
"type": "autodate"
},
{
"hidden": false,
"id": "autodate3332085495",
"name": "updated",
"onCreate": true,
"onUpdate": true,
"presentable": false,
"system": false,
"type": "autodate"
}
],
"id": "pbc_362615506",
"indexes": [],
"listRule": null,
"name": "review_votes",
"system": false,
"type": "base",
"updateRule": null,
"viewRule": null
});
return app.save(collection);
}, (app) => {
const collection = app.findCollectionByNameOrId("pbc_362615506");
return app.delete(collection);
})

View file

@ -0,0 +1,65 @@
/// <reference path="../pb_data/types.d.ts" />
migrate((app) => {
const collection = app.findCollectionByNameOrId("pbc_362615506")
// add field
collection.fields.addAt(1, new Field({
"cascadeDelete": false,
"collectionId": "pbc_4163081445",
"hidden": false,
"id": "relation2034467270",
"maxSelect": 1,
"minSelect": 0,
"name": "review",
"presentable": false,
"required": false,
"system": false,
"type": "relation"
}))
// add field
collection.fields.addAt(2, new Field({
"cascadeDelete": false,
"collectionId": "_pb_users_auth_",
"hidden": false,
"id": "relation2375276105",
"maxSelect": 1,
"minSelect": 0,
"name": "user",
"presentable": false,
"required": false,
"system": false,
"type": "relation"
}))
// add field
collection.fields.addAt(3, new Field({
"hidden": false,
"id": "select1002219032",
"maxSelect": 1,
"name": "vote_type",
"presentable": false,
"required": false,
"system": false,
"type": "select",
"values": [
"likes",
"dislikes"
]
}))
return app.save(collection)
}, (app) => {
const collection = app.findCollectionByNameOrId("pbc_362615506")
// remove field
collection.fields.removeById("relation2034467270")
// remove field
collection.fields.removeById("relation2375276105")
// remove field
collection.fields.removeById("select1002219032")
return app.save(collection)
})

View file

@ -0,0 +1,28 @@
/// <reference path="../pb_data/types.d.ts" />
migrate((app) => {
const collection = app.findCollectionByNameOrId("pbc_362615506")
// update collection data
unmarshal({
"createRule": "@request.auth.id != \"\"",
"deleteRule": "user = @request.auth.id",
"listRule": "@request.auth.id != \"\"",
"updateRule": "user = @request.auth.id",
"viewRule": "@request.auth.id != \"\""
}, collection)
return app.save(collection)
}, (app) => {
const collection = app.findCollectionByNameOrId("pbc_362615506")
// update collection data
unmarshal({
"createRule": null,
"deleteRule": null,
"listRule": null,
"updateRule": null,
"viewRule": null
}, collection)
return app.save(collection)
})