Новые изменения
This commit is contained in:
parent
dc00e31578
commit
e621b3c40e
8 changed files with 234 additions and 54 deletions
112
backend/pb_migrations/1777232002_created_post_views.js
Normal file
112
backend/pb_migrations/1777232002_created_post_views.js
Normal file
|
|
@ -0,0 +1,112 @@
|
|||
/// <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"
|
||||
},
|
||||
{
|
||||
"cascadeDelete": false,
|
||||
"collectionId": "pbc_1125843985",
|
||||
"hidden": false,
|
||||
"id": "relation1519021197",
|
||||
"maxSelect": 1,
|
||||
"minSelect": 0,
|
||||
"name": "post",
|
||||
"presentable": false,
|
||||
"required": false,
|
||||
"system": false,
|
||||
"type": "relation"
|
||||
},
|
||||
{
|
||||
"autogeneratePattern": "",
|
||||
"hidden": false,
|
||||
"id": "text791980464",
|
||||
"max": 0,
|
||||
"min": 0,
|
||||
"name": "visitor_hash",
|
||||
"pattern": "",
|
||||
"presentable": false,
|
||||
"primaryKey": false,
|
||||
"required": false,
|
||||
"system": false,
|
||||
"type": "text"
|
||||
},
|
||||
{
|
||||
"autogeneratePattern": "",
|
||||
"hidden": false,
|
||||
"id": "text2783163181",
|
||||
"max": 0,
|
||||
"min": 0,
|
||||
"name": "ip",
|
||||
"pattern": "",
|
||||
"presentable": false,
|
||||
"primaryKey": false,
|
||||
"required": false,
|
||||
"system": false,
|
||||
"type": "text"
|
||||
},
|
||||
{
|
||||
"autogeneratePattern": "",
|
||||
"hidden": false,
|
||||
"id": "text3293145029",
|
||||
"max": 0,
|
||||
"min": 0,
|
||||
"name": "user_agent",
|
||||
"pattern": "",
|
||||
"presentable": false,
|
||||
"primaryKey": false,
|
||||
"required": false,
|
||||
"system": false,
|
||||
"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_2019238136",
|
||||
"indexes": [],
|
||||
"listRule": null,
|
||||
"name": "post_views",
|
||||
"system": false,
|
||||
"type": "base",
|
||||
"updateRule": null,
|
||||
"viewRule": null
|
||||
});
|
||||
|
||||
return app.save(collection);
|
||||
}, (app) => {
|
||||
const collection = app.findCollectionByNameOrId("pbc_2019238136");
|
||||
|
||||
return app.delete(collection);
|
||||
})
|
||||
22
backend/pb_migrations/1777232058_updated_post_views.js
Normal file
22
backend/pb_migrations/1777232058_updated_post_views.js
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
/// <reference path="../pb_data/types.d.ts" />
|
||||
migrate((app) => {
|
||||
const collection = app.findCollectionByNameOrId("pbc_2019238136")
|
||||
|
||||
// update collection data
|
||||
unmarshal({
|
||||
"deleteRule": "@request.auth.id != ''",
|
||||
"updateRule": "@request.auth.id != ''"
|
||||
}, collection)
|
||||
|
||||
return app.save(collection)
|
||||
}, (app) => {
|
||||
const collection = app.findCollectionByNameOrId("pbc_2019238136")
|
||||
|
||||
// update collection data
|
||||
unmarshal({
|
||||
"deleteRule": null,
|
||||
"updateRule": null
|
||||
}, collection)
|
||||
|
||||
return app.save(collection)
|
||||
})
|
||||
20
backend/pb_migrations/1777232226_updated_post_views.js
Normal file
20
backend/pb_migrations/1777232226_updated_post_views.js
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
/// <reference path="../pb_data/types.d.ts" />
|
||||
migrate((app) => {
|
||||
const collection = app.findCollectionByNameOrId("pbc_2019238136")
|
||||
|
||||
// update collection data
|
||||
unmarshal({
|
||||
"updateRule": "@request.auth.id != \"\""
|
||||
}, collection)
|
||||
|
||||
return app.save(collection)
|
||||
}, (app) => {
|
||||
const collection = app.findCollectionByNameOrId("pbc_2019238136")
|
||||
|
||||
// update collection data
|
||||
unmarshal({
|
||||
"updateRule": "@request.auth.id != ''"
|
||||
}, collection)
|
||||
|
||||
return app.save(collection)
|
||||
})
|
||||
24
backend/pb_migrations/1777232798_updated_post_views.js
Normal file
24
backend/pb_migrations/1777232798_updated_post_views.js
Normal file
|
|
@ -0,0 +1,24 @@
|
|||
/// <reference path="../pb_data/types.d.ts" />
|
||||
migrate((app) => {
|
||||
const collection = app.findCollectionByNameOrId("pbc_2019238136")
|
||||
|
||||
// update collection data
|
||||
unmarshal({
|
||||
"createRule": "@request.method = \"POST\"",
|
||||
"listRule": "@request.method = \"GET\"",
|
||||
"viewRule": "@request.method = \"GET\""
|
||||
}, collection)
|
||||
|
||||
return app.save(collection)
|
||||
}, (app) => {
|
||||
const collection = app.findCollectionByNameOrId("pbc_2019238136")
|
||||
|
||||
// update collection data
|
||||
unmarshal({
|
||||
"createRule": null,
|
||||
"listRule": null,
|
||||
"viewRule": null
|
||||
}, collection)
|
||||
|
||||
return app.save(collection)
|
||||
})
|
||||
Loading…
Add table
Add a link
Reference in a new issue