A round took 22-29 min an hour: every match went through the insert's conflict check (60-150 s a rule), scraped and locked each scanned all of releases. The spot inspector's releases now add their poster to posters. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
23 lines
953 B
TypeScript
23 lines
953 B
TypeScript
import { BaseSchema } from '@adonisjs/lucid/schema'
|
|
|
|
/**
|
|
* The junk judge's locked rule by an index of the passworded releases (1.2M of 74M), not a scan of all of releases
|
|
* every round (30 s; LOG.md 2026-10-19 (80)). And the posters of the spot inspector's own releases (source `spot`),
|
|
* which it didn't add to posters: poster search, and the judge's scraped rule by posters, missed them.
|
|
*/
|
|
export default class extends BaseSchema {
|
|
static disableTransactions = true
|
|
|
|
async up() {
|
|
this.schema.raw(`CREATE INDEX CONCURRENTLY IF NOT EXISTS releases_passworded_idx ON releases (id) WHERE passworded`)
|
|
this.schema.raw(
|
|
`INSERT INTO posters (poster) SELECT DISTINCT left(s.poster, 200) FROM spots s
|
|
JOIN releases r ON r.id = s.release_id AND r.source = 'spot' WHERE s.poster IS NOT NULL ON CONFLICT DO NOTHING`
|
|
)
|
|
}
|
|
|
|
async down() {
|
|
this.schema.raw(`DROP INDEX CONCURRENTLY IF EXISTS releases_passworded_idx`)
|
|
}
|
|
}
|