import { BaseSchema } from '@adonisjs/lucid/schema' /** * What a probed article showed, by message-id (app/services/prober.ts): an * article's inspection doesn't depend on the grouping rules, so a catalog * reset (which empties the probe queue) needn't read it from the news server * again. `version` is PROBE_VERSION when it was inspected: a change to the * inspection makes older rows stale. Not truncated by a reset. */ export default class extends BaseSchema { async up() { this.schema.raw(` CREATE TABLE probe_cache ( message_id text PRIMARY KEY, status varchar(8) NOT NULL, result jsonb, version integer NOT NULL, created_at timestamptz NOT NULL DEFAULT now() )`) } async down() { this.schema.raw(`DROP TABLE IF EXISTS probe_cache`) } }