import { BaseSchema } from '@adonisjs/lucid/schema' /** * The prober claims waiting candidates by kind from random points of the * queue (Prober.claim): by the id index alone a slice filtered ~700k rows for * the rarer kinds (0.37 s a slice, 20 slices and up to 5 tiers a claim, the * lanes waiting meanwhile; LOG.md 2026-10-12 (17)). Built concurrently. */ export default class extends BaseSchema { static disableTransactions = true async up() { this.schema.raw(`CREATE INDEX CONCURRENTLY IF NOT EXISTS probe_candidates_kind_waiting_idx ON probe_candidates (kind, id) WHERE status = 'waiting'`) } async down() { this.schema.raw(`DROP INDEX CONCURRENTLY IF EXISTS probe_candidates_kind_waiting_idx`) } }