Add pocketbase migrations
This commit is contained in:
parent
c75003f5f0
commit
0d330c4f60
13 changed files with 547 additions and 0 deletions
33
pb_migrations/1702061316_updated_tasklists.js
Normal file
33
pb_migrations/1702061316_updated_tasklists.js
Normal file
|
|
@ -0,0 +1,33 @@
|
|||
/// <reference path="../pb_data/types.d.ts" />
|
||||
migrate((db) => {
|
||||
const dao = new Dao(db)
|
||||
const collection = dao.findCollectionByNameOrId("i42xt9r6ykqdq3j")
|
||||
|
||||
// add
|
||||
collection.schema.addField(new SchemaField({
|
||||
"system": false,
|
||||
"id": "vm4xdjfy",
|
||||
"name": "parentList",
|
||||
"type": "relation",
|
||||
"required": false,
|
||||
"presentable": false,
|
||||
"unique": false,
|
||||
"options": {
|
||||
"collectionId": "i42xt9r6ykqdq3j",
|
||||
"cascadeDelete": true,
|
||||
"minSelect": null,
|
||||
"maxSelect": 1,
|
||||
"displayFields": null
|
||||
}
|
||||
}))
|
||||
|
||||
return dao.saveCollection(collection)
|
||||
}, (db) => {
|
||||
const dao = new Dao(db)
|
||||
const collection = dao.findCollectionByNameOrId("i42xt9r6ykqdq3j")
|
||||
|
||||
// remove
|
||||
collection.schema.removeField("vm4xdjfy")
|
||||
|
||||
return dao.saveCollection(collection)
|
||||
})
|
||||
Loading…
Add table
Add a link
Reference in a new issue