dobo 2.6.0 → 2.6.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/collect-models.js +1 -2
- package/lib/factory/model/_util.js +3 -3
- package/package.json +1 -1
- package/wiki/CHANGES.md +1 -1
package/lib/collect-models.js
CHANGED
|
@@ -203,8 +203,6 @@ export async function sanitizeAll (model) {
|
|
|
203
203
|
}
|
|
204
204
|
}
|
|
205
205
|
await runHook(`dobo.${camelCase(model.name)}:afterSanitizeModel`, model)
|
|
206
|
-
// fields that can participate in table scan if needed
|
|
207
|
-
model.scans = []
|
|
208
206
|
// sorting only possible using these fields
|
|
209
207
|
model.sortables = []
|
|
210
208
|
for (const index of model.indexes) {
|
|
@@ -239,6 +237,7 @@ async function createSchema (item) {
|
|
|
239
237
|
item.connection = null
|
|
240
238
|
item.hooks = item.hooks ?? []
|
|
241
239
|
item.disabled = item.disabled ?? []
|
|
240
|
+
item.scanables = item.scanables ?? []
|
|
242
241
|
if (item.disabled === 'all') item.disabled = ['find', 'get', 'create', 'update', 'remove']
|
|
243
242
|
else if (item.disabled === 'readonly') item.disabled = ['create', 'update', 'remove']
|
|
244
243
|
// Is there any overwritten connection?
|
|
@@ -237,9 +237,9 @@ export function buildFilterQuery (filter = {}) {
|
|
|
237
237
|
filter.search = q
|
|
238
238
|
return {} //
|
|
239
239
|
} else {
|
|
240
|
-
let
|
|
241
|
-
if (
|
|
242
|
-
const fields =
|
|
240
|
+
let scanables = [...this.scanables]
|
|
241
|
+
if (scanables.length === 0) scanables = [...this.sortables]
|
|
242
|
+
const fields = scanables.filter(f => {
|
|
243
243
|
const field = find(this.properties, { name: f, type: 'string' })
|
|
244
244
|
return !!field
|
|
245
245
|
})
|
package/package.json
CHANGED
package/wiki/CHANGES.md
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
## 2026-02-01
|
|
4
4
|
|
|
5
|
-
- [2.6.0] Add ```model.
|
|
5
|
+
- [2.6.0] Add ```model.scanables``` for fields that can participate in table scans if necessary
|
|
6
6
|
- [2.6.0] Add ```driver.support.search``` for driver's fulltext search support
|
|
7
7
|
- [2.6.0] Add model hooks ```before/afterBuildQuery/Search```
|
|
8
8
|
|