Files
usenet-indexer/database/migrations/1770000001000_releases_unsettled_index.ts
T
Daan MeijerandClaude Opus 5.5 80c920f678
Test and deploy / test (push) Successful in 21s
Test and deploy / deploy (push) Skipped
Rebuild: settling quiet releases
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>
2026-10-09 02:33:47 +02:00

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`)
}
}