Files
usenet-indexer/database/migrations/1770000003000_spots_nzb_only_unmatched.ts
T
Daan MeijerandClaude Opus 5.5 1b64fed427
Test and deploy / test (push) Successful in 1m6s
Test and deploy / edge (push) Successful in 2m47s
Test and deploy / deploy (push) Successful in 1m26s
Spots: a matched spot's NZB isn't kept
Only a spot that becomes a release of its own needs its NZB (the header
pass's releases have their chunks); spots took 2.7 GB on the NVMe at 9k.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-13 16:42:26 +02:00

11 lines
352 B
TypeScript

import { BaseSchema } from '@adonisjs/lucid/schema'
/** A matched spot's NZB isn't kept (its releases have their chunks): only a spot of its own needs one (2.7 GB at 9k spots). */
export default class extends BaseSchema {
async up() {
this.schema.raw(`UPDATE spots SET nzb = NULL WHERE matched > 0 AND nzb IS NOT NULL`)
}
async down() {}
}