pocketbase_demo/pb_migrations/1771621247_updated_articles.js

24 lines
1.1 KiB
JavaScript

/// <reference path="../pb_data/types.d.ts" />
migrate((app) => {
const collection = app.findCollectionByNameOrId("pbc_4287850865")
// update collection data
unmarshal({
"listRule": "published = true || author.id ?= @request.auth.id || @request.auth.collectionName = \"_superusers\"",
"updateRule": "published = true || author.id ?= @request.auth.id || @request.auth.collectionName = \"_superusers\"",
"viewRule": "published = true || author.id ?= @request.auth.id || @request.auth.collectionName = \"_superusers\""
}, collection)
return app.save(collection)
}, (app) => {
const collection = app.findCollectionByNameOrId("pbc_4287850865")
// update collection data
unmarshal({
"listRule": "published = true || author ?= @request.auth.id || @request.auth.collectionName = \"_superusers\"",
"updateRule": "published = true || author ?= @request.auth.id || @request.auth.collectionName = \"_superusers\"",
"viewRule": "published = true || author ?= @request.auth.id || @request.auth.collectionName = \"_superusers\""
}, collection)
return app.save(collection)
})