Hourly in coordinator:run: a release unchanged for 6 hours is settled, complete when every file its [i/N] counter announced was found, unknown without a counter (phase 2 reads par2 sets for those). Partial index on unsettled releases. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
13 lines
411 B
TypeScript
13 lines
411 B
TypeScript
import { BaseSchema } from '@adonisjs/lucid/schema'
|
|
|
|
/** Releases still to settle (REBUILD.md, part 8), by when they last changed. */
|
|
export default class extends BaseSchema {
|
|
async up() {
|
|
this.schema.raw(`CREATE INDEX IF NOT EXISTS releases_unsettled_idx ON releases (last_seen_at) WHERE settled_at IS NULL`)
|
|
}
|
|
|
|
async down() {
|
|
this.schema.raw(`DROP INDEX IF EXISTS releases_unsettled_idx`)
|
|
}
|
|
}
|