Насторил работу блога через Backend
This commit is contained in:
parent
014439d565
commit
edd730b438
33 changed files with 1019 additions and 200 deletions
37
backend/pb_migrations/1776199882_created_posts.js
Normal file
37
backend/pb_migrations/1776199882_created_posts.js
Normal file
|
|
@ -0,0 +1,37 @@
|
|||
/// <reference path="../pb_data/types.d.ts" />
|
||||
migrate((app) => {
|
||||
const collection = new Collection({
|
||||
"createRule": "@request.auth.id != \"\"",
|
||||
"deleteRule": "@request.auth.id != \"\"",
|
||||
"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"
|
||||
}
|
||||
],
|
||||
"id": "pbc_1125843985",
|
||||
"indexes": [],
|
||||
"listRule": "",
|
||||
"name": "posts",
|
||||
"system": false,
|
||||
"type": "base",
|
||||
"updateRule": "@request.auth.id != \"\"",
|
||||
"viewRule": ""
|
||||
});
|
||||
|
||||
return app.save(collection);
|
||||
}, (app) => {
|
||||
const collection = app.findCollectionByNameOrId("pbc_1125843985");
|
||||
|
||||
return app.delete(collection);
|
||||
})
|
||||
29
backend/pb_migrations/1776200325_updated_posts.js
Normal file
29
backend/pb_migrations/1776200325_updated_posts.js
Normal file
|
|
@ -0,0 +1,29 @@
|
|||
/// <reference path="../pb_data/types.d.ts" />
|
||||
migrate((app) => {
|
||||
const collection = app.findCollectionByNameOrId("pbc_1125843985")
|
||||
|
||||
// add field
|
||||
collection.fields.addAt(1, new Field({
|
||||
"autogeneratePattern": "",
|
||||
"hidden": false,
|
||||
"id": "text724990059",
|
||||
"max": 0,
|
||||
"min": 0,
|
||||
"name": "title",
|
||||
"pattern": "",
|
||||
"presentable": false,
|
||||
"primaryKey": false,
|
||||
"required": false,
|
||||
"system": false,
|
||||
"type": "text"
|
||||
}))
|
||||
|
||||
return app.save(collection)
|
||||
}, (app) => {
|
||||
const collection = app.findCollectionByNameOrId("pbc_1125843985")
|
||||
|
||||
// remove field
|
||||
collection.fields.removeById("text724990059")
|
||||
|
||||
return app.save(collection)
|
||||
})
|
||||
29
backend/pb_migrations/1776200337_updated_posts.js
Normal file
29
backend/pb_migrations/1776200337_updated_posts.js
Normal file
|
|
@ -0,0 +1,29 @@
|
|||
/// <reference path="../pb_data/types.d.ts" />
|
||||
migrate((app) => {
|
||||
const collection = app.findCollectionByNameOrId("pbc_1125843985")
|
||||
|
||||
// add field
|
||||
collection.fields.addAt(2, new Field({
|
||||
"autogeneratePattern": "",
|
||||
"hidden": false,
|
||||
"id": "text1843675174",
|
||||
"max": 0,
|
||||
"min": 0,
|
||||
"name": "description",
|
||||
"pattern": "",
|
||||
"presentable": false,
|
||||
"primaryKey": false,
|
||||
"required": false,
|
||||
"system": false,
|
||||
"type": "text"
|
||||
}))
|
||||
|
||||
return app.save(collection)
|
||||
}, (app) => {
|
||||
const collection = app.findCollectionByNameOrId("pbc_1125843985")
|
||||
|
||||
// remove field
|
||||
collection.fields.removeById("text1843675174")
|
||||
|
||||
return app.save(collection)
|
||||
})
|
||||
29
backend/pb_migrations/1776200351_updated_posts.js
Normal file
29
backend/pb_migrations/1776200351_updated_posts.js
Normal file
|
|
@ -0,0 +1,29 @@
|
|||
/// <reference path="../pb_data/types.d.ts" />
|
||||
migrate((app) => {
|
||||
const collection = app.findCollectionByNameOrId("pbc_1125843985")
|
||||
|
||||
// add field
|
||||
collection.fields.addAt(3, new Field({
|
||||
"autogeneratePattern": "",
|
||||
"hidden": false,
|
||||
"id": "text3182418120",
|
||||
"max": 0,
|
||||
"min": 0,
|
||||
"name": "author",
|
||||
"pattern": "",
|
||||
"presentable": false,
|
||||
"primaryKey": false,
|
||||
"required": false,
|
||||
"system": false,
|
||||
"type": "text"
|
||||
}))
|
||||
|
||||
return app.save(collection)
|
||||
}, (app) => {
|
||||
const collection = app.findCollectionByNameOrId("pbc_1125843985")
|
||||
|
||||
// remove field
|
||||
collection.fields.removeById("text3182418120")
|
||||
|
||||
return app.save(collection)
|
||||
})
|
||||
29
backend/pb_migrations/1776200365_updated_posts.js
Normal file
29
backend/pb_migrations/1776200365_updated_posts.js
Normal file
|
|
@ -0,0 +1,29 @@
|
|||
/// <reference path="../pb_data/types.d.ts" />
|
||||
migrate((app) => {
|
||||
const collection = app.findCollectionByNameOrId("pbc_1125843985")
|
||||
|
||||
// add field
|
||||
collection.fields.addAt(4, new Field({
|
||||
"autogeneratePattern": "",
|
||||
"hidden": false,
|
||||
"id": "text105650625",
|
||||
"max": 0,
|
||||
"min": 0,
|
||||
"name": "category",
|
||||
"pattern": "",
|
||||
"presentable": false,
|
||||
"primaryKey": false,
|
||||
"required": false,
|
||||
"system": false,
|
||||
"type": "text"
|
||||
}))
|
||||
|
||||
return app.save(collection)
|
||||
}, (app) => {
|
||||
const collection = app.findCollectionByNameOrId("pbc_1125843985")
|
||||
|
||||
// remove field
|
||||
collection.fields.removeById("text105650625")
|
||||
|
||||
return app.save(collection)
|
||||
})
|
||||
29
backend/pb_migrations/1776200395_updated_posts.js
Normal file
29
backend/pb_migrations/1776200395_updated_posts.js
Normal file
|
|
@ -0,0 +1,29 @@
|
|||
/// <reference path="../pb_data/types.d.ts" />
|
||||
migrate((app) => {
|
||||
const collection = app.findCollectionByNameOrId("pbc_1125843985")
|
||||
|
||||
// add field
|
||||
collection.fields.addAt(5, new Field({
|
||||
"autogeneratePattern": "",
|
||||
"hidden": false,
|
||||
"id": "text1898540465",
|
||||
"max": 0,
|
||||
"min": 0,
|
||||
"name": "categoryColor",
|
||||
"pattern": "",
|
||||
"presentable": false,
|
||||
"primaryKey": false,
|
||||
"required": false,
|
||||
"system": false,
|
||||
"type": "text"
|
||||
}))
|
||||
|
||||
return app.save(collection)
|
||||
}, (app) => {
|
||||
const collection = app.findCollectionByNameOrId("pbc_1125843985")
|
||||
|
||||
// remove field
|
||||
collection.fields.removeById("text1898540465")
|
||||
|
||||
return app.save(collection)
|
||||
})
|
||||
26
backend/pb_migrations/1776200412_updated_posts.js
Normal file
26
backend/pb_migrations/1776200412_updated_posts.js
Normal file
|
|
@ -0,0 +1,26 @@
|
|||
/// <reference path="../pb_data/types.d.ts" />
|
||||
migrate((app) => {
|
||||
const collection = app.findCollectionByNameOrId("pbc_1125843985")
|
||||
|
||||
// add field
|
||||
collection.fields.addAt(6, new Field({
|
||||
"hidden": false,
|
||||
"id": "date2862495610",
|
||||
"max": "",
|
||||
"min": "",
|
||||
"name": "date",
|
||||
"presentable": false,
|
||||
"required": false,
|
||||
"system": false,
|
||||
"type": "date"
|
||||
}))
|
||||
|
||||
return app.save(collection)
|
||||
}, (app) => {
|
||||
const collection = app.findCollectionByNameOrId("pbc_1125843985")
|
||||
|
||||
// remove field
|
||||
collection.fields.removeById("date2862495610")
|
||||
|
||||
return app.save(collection)
|
||||
})
|
||||
29
backend/pb_migrations/1776200439_updated_posts.js
Normal file
29
backend/pb_migrations/1776200439_updated_posts.js
Normal file
|
|
@ -0,0 +1,29 @@
|
|||
/// <reference path="../pb_data/types.d.ts" />
|
||||
migrate((app) => {
|
||||
const collection = app.findCollectionByNameOrId("pbc_1125843985")
|
||||
|
||||
// add field
|
||||
collection.fields.addAt(7, new Field({
|
||||
"autogeneratePattern": "",
|
||||
"hidden": false,
|
||||
"id": "text1864383797",
|
||||
"max": 0,
|
||||
"min": 0,
|
||||
"name": "readmeTime",
|
||||
"pattern": "",
|
||||
"presentable": false,
|
||||
"primaryKey": false,
|
||||
"required": false,
|
||||
"system": false,
|
||||
"type": "text"
|
||||
}))
|
||||
|
||||
return app.save(collection)
|
||||
}, (app) => {
|
||||
const collection = app.findCollectionByNameOrId("pbc_1125843985")
|
||||
|
||||
// remove field
|
||||
collection.fields.removeById("text1864383797")
|
||||
|
||||
return app.save(collection)
|
||||
})
|
||||
29
backend/pb_migrations/1776200454_updated_posts.js
Normal file
29
backend/pb_migrations/1776200454_updated_posts.js
Normal file
|
|
@ -0,0 +1,29 @@
|
|||
/// <reference path="../pb_data/types.d.ts" />
|
||||
migrate((app) => {
|
||||
const collection = app.findCollectionByNameOrId("pbc_1125843985")
|
||||
|
||||
// add field
|
||||
collection.fields.addAt(8, new Field({
|
||||
"autogeneratePattern": "",
|
||||
"hidden": false,
|
||||
"id": "text2548032275",
|
||||
"max": 0,
|
||||
"min": 0,
|
||||
"name": "imageUrl",
|
||||
"pattern": "",
|
||||
"presentable": false,
|
||||
"primaryKey": false,
|
||||
"required": false,
|
||||
"system": false,
|
||||
"type": "text"
|
||||
}))
|
||||
|
||||
return app.save(collection)
|
||||
}, (app) => {
|
||||
const collection = app.findCollectionByNameOrId("pbc_1125843985")
|
||||
|
||||
// remove field
|
||||
collection.fields.removeById("text2548032275")
|
||||
|
||||
return app.save(collection)
|
||||
})
|
||||
29
backend/pb_migrations/1776200465_updated_posts.js
Normal file
29
backend/pb_migrations/1776200465_updated_posts.js
Normal file
|
|
@ -0,0 +1,29 @@
|
|||
/// <reference path="../pb_data/types.d.ts" />
|
||||
migrate((app) => {
|
||||
const collection = app.findCollectionByNameOrId("pbc_1125843985")
|
||||
|
||||
// add field
|
||||
collection.fields.addAt(9, new Field({
|
||||
"autogeneratePattern": "",
|
||||
"hidden": false,
|
||||
"id": "text2560465762",
|
||||
"max": 0,
|
||||
"min": 0,
|
||||
"name": "slug",
|
||||
"pattern": "",
|
||||
"presentable": false,
|
||||
"primaryKey": false,
|
||||
"required": false,
|
||||
"system": false,
|
||||
"type": "text"
|
||||
}))
|
||||
|
||||
return app.save(collection)
|
||||
}, (app) => {
|
||||
const collection = app.findCollectionByNameOrId("pbc_1125843985")
|
||||
|
||||
// remove field
|
||||
collection.fields.removeById("text2560465762")
|
||||
|
||||
return app.save(collection)
|
||||
})
|
||||
24
backend/pb_migrations/1776200481_updated_posts.js
Normal file
24
backend/pb_migrations/1776200481_updated_posts.js
Normal file
|
|
@ -0,0 +1,24 @@
|
|||
/// <reference path="../pb_data/types.d.ts" />
|
||||
migrate((app) => {
|
||||
const collection = app.findCollectionByNameOrId("pbc_1125843985")
|
||||
|
||||
// add field
|
||||
collection.fields.addAt(10, new Field({
|
||||
"hidden": false,
|
||||
"id": "bool1182570132",
|
||||
"name": "draft",
|
||||
"presentable": false,
|
||||
"required": false,
|
||||
"system": false,
|
||||
"type": "bool"
|
||||
}))
|
||||
|
||||
return app.save(collection)
|
||||
}, (app) => {
|
||||
const collection = app.findCollectionByNameOrId("pbc_1125843985")
|
||||
|
||||
// remove field
|
||||
collection.fields.removeById("bool1182570132")
|
||||
|
||||
return app.save(collection)
|
||||
})
|
||||
26
backend/pb_migrations/1776200499_updated_posts.js
Normal file
26
backend/pb_migrations/1776200499_updated_posts.js
Normal file
|
|
@ -0,0 +1,26 @@
|
|||
/// <reference path="../pb_data/types.d.ts" />
|
||||
migrate((app) => {
|
||||
const collection = app.findCollectionByNameOrId("pbc_1125843985")
|
||||
|
||||
// add field
|
||||
collection.fields.addAt(11, new Field({
|
||||
"convertURLs": false,
|
||||
"hidden": false,
|
||||
"id": "editor4274335913",
|
||||
"maxSize": 0,
|
||||
"name": "content",
|
||||
"presentable": false,
|
||||
"required": false,
|
||||
"system": false,
|
||||
"type": "editor"
|
||||
}))
|
||||
|
||||
return app.save(collection)
|
||||
}, (app) => {
|
||||
const collection = app.findCollectionByNameOrId("pbc_1125843985")
|
||||
|
||||
// remove field
|
||||
collection.fields.removeById("editor4274335913")
|
||||
|
||||
return app.save(collection)
|
||||
})
|
||||
22
backend/pb_migrations/1776200529_updated_posts.js
Normal file
22
backend/pb_migrations/1776200529_updated_posts.js
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
/// <reference path="../pb_data/types.d.ts" />
|
||||
migrate((app) => {
|
||||
const collection = app.findCollectionByNameOrId("pbc_1125843985")
|
||||
|
||||
// update collection data
|
||||
unmarshal({
|
||||
"listRule": null,
|
||||
"viewRule": null
|
||||
}, collection)
|
||||
|
||||
return app.save(collection)
|
||||
}, (app) => {
|
||||
const collection = app.findCollectionByNameOrId("pbc_1125843985")
|
||||
|
||||
// update collection data
|
||||
unmarshal({
|
||||
"listRule": "",
|
||||
"viewRule": ""
|
||||
}, collection)
|
||||
|
||||
return app.save(collection)
|
||||
})
|
||||
22
backend/pb_migrations/1776200951_updated_posts.js
Normal file
22
backend/pb_migrations/1776200951_updated_posts.js
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
/// <reference path="../pb_data/types.d.ts" />
|
||||
migrate((app) => {
|
||||
const collection = app.findCollectionByNameOrId("pbc_1125843985")
|
||||
|
||||
// update collection data
|
||||
unmarshal({
|
||||
"listRule": " draft = false || @request.auth.id != \"\" ",
|
||||
"viewRule": " draft = false || @request.auth.id != \"\" "
|
||||
}, collection)
|
||||
|
||||
return app.save(collection)
|
||||
}, (app) => {
|
||||
const collection = app.findCollectionByNameOrId("pbc_1125843985")
|
||||
|
||||
// update collection data
|
||||
unmarshal({
|
||||
"listRule": null,
|
||||
"viewRule": null
|
||||
}, collection)
|
||||
|
||||
return app.save(collection)
|
||||
})
|
||||
Loading…
Add table
Add a link
Reference in a new issue