-
Notifications
You must be signed in to change notification settings - Fork 1
/
1683577325_updated_orders.js
73 lines (65 loc) · 1.52 KB
/
1683577325_updated_orders.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
migrate((db) => {
const dao = new Dao(db)
const collection = dao.findCollectionByNameOrId("m37x1cgs4zbssep")
// add
collection.schema.addField(new SchemaField({
"system": false,
"id": "oz96pkyf",
"name": "client_full_name",
"type": "text",
"required": false,
"unique": false,
"options": {
"min": null,
"max": null,
"pattern": ""
}
}))
// add
collection.schema.addField(new SchemaField({
"system": false,
"id": "4lprz7om",
"name": "model_name",
"type": "relation",
"required": false,
"unique": false,
"options": {
"collectionId": "ucg00sxxgksrkxn",
"cascadeDelete": false,
"minSelect": null,
"maxSelect": 1,
"displayFields": [
"model_name"
]
}
}))
// add
collection.schema.addField(new SchemaField({
"system": false,
"id": "l8h2gayb",
"name": "ressource_names",
"type": "relation",
"required": false,
"unique": false,
"options": {
"collectionId": "eswftit38yxnbpp",
"cascadeDelete": false,
"minSelect": null,
"maxSelect": null,
"displayFields": [
"supply_name"
]
}
}))
return dao.saveCollection(collection)
}, (db) => {
const dao = new Dao(db)
const collection = dao.findCollectionByNameOrId("m37x1cgs4zbssep")
// remove
collection.schema.removeField("oz96pkyf")
// remove
collection.schema.removeField("4lprz7om")
// remove
collection.schema.removeField("l8h2gayb")
return dao.saveCollection(collection)
})