dobo-knex
Version:
Knex/SQL driver for Dobo
17 lines (13 loc) • 398 B
JavaScript
import { create } from '../../method/model/create.js'
async function applyTable (schema, table) {
for (const ft of schema.fullText ?? []) {
for (const f of ft.fields ?? []) {
table.specificType(f, 'tsvector')
table.index(f, null, 'gin')
}
}
}
async function modelCreate (schema) {
await create.call(this.schema, applyTable)
}
export default modelCreate