import { BaseSchema } from '@adonisjs/lucid/schema' /** * Files cut off by a range's edge (REBUILD.md, fragments): one row per file * and range, with that range's segments; merged when the neighbouring range * is done, then written as a chunk. */ export default class extends BaseSchema { async up() { this.schema.createTable('fragments', (table) => { table.bigIncrements('id') table.bigInteger('range_id').notNullable() table.string('file_key', 40).notNullable() // The file's first article in this range. table.bigInteger('article_number').notNullable() table.integer('segments').notNullable() table.jsonb('fragment').notNullable() table.index(['file_key']) table.index(['range_id']) }) } async down() { this.schema.dropTable('fragments') } }