import { BaseSchema } from '@adonisjs/lucid/schema' /** * Header backfill (CONCEPT.md D32): a group walks backwards from * `backfill_next_id` down to `backfill_until_id` in low-priority, * header-only fetch ranges (`fetch_ranges.backfill`). */ export default class extends BaseSchema { async up() { this.schema.alterTable('groups', (table) => { table.bigInteger('backfill_until_id') table.bigInteger('backfill_next_id') }) this.schema.alterTable('fetch_ranges', (table) => { table.boolean('backfill').notNullable().defaultTo(false) }) } async down() { this.schema.alterTable('groups', (table) => { table.dropColumn('backfill_until_id') table.dropColumn('backfill_next_id') }) this.schema.alterTable('fetch_ranges', (table) => table.dropColumn('backfill')) } }