-
I'm trying to add a partial index. It's mentioned at knex docs here
Their example is like this: knex.table('users', function (table) {
table.index(['name', 'last_name'], 'idx_name_last_name', {
predicate: knex.whereNotNull('email'),
});
}); But this is not documented at adonisjs docs site. How do I pass a where predicate to create a partial index. What I've triedthis.schema.alterTable(this.tableName, (table) => {
table.index('book_id', undefined, {
predicate: {
where: this.db.from(this.tableName).where('is_listed', true),
},
})
}) Gives type error: Type 'DatabaseQueryBuilderContract' is not assignable to type 'Where<any, any>' |
Beta Was this translation helpful? Give feedback.
Answered by
brkn
May 29, 2022
Replies: 1 comment
-
Moved to adonisjs/lucid#832 |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
brkn
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Moved to adonisjs/lucid#832