implemented a lot of features

This commit is contained in:
Daan Meijer committed 2026-09-29 00:32:01 +02:00
1 parent 62f1767df3
commit bcb9be5da9
141 files changed
+10705 -385

No files matched your search

@@ -0,0 +1,32 @@
import { BaseSchema } from '@adonisjs/lucid/schema'
/**
* Splitting equal-sized obfuscated volumes (CONCEPT.md D20): the extra
* articles of conflicted binaries are kept, and the split-off volumes point
* to the conflicted binary they came from.
*/
export default class extends BaseSchema {
async up() {
this.schema.createTable('part_conflicts', (table) => {
table.bigInteger('binary_id').notNullable().references('binaries.id').onDelete('CASCADE')
table.integer('number').notNullable()
table.text('message_id').notNullable()
table.integer('bytes').notNullable()
table.bigInteger('article_number')
table.primary(['binary_id', 'number', 'message_id'])
})
this.schema.alterTable('binaries', (table) => {
table.bigInteger('parent_binary_id').references('binaries.id').onDelete('SET NULL').index()
// Last time the splitter processed this conflicted binary.
table.timestamp('split_at', { useTz: true })
})
}
async down() {
this.schema.alterTable('binaries', (table) => {
table.dropColumn('split_at')
table.dropColumn('parent_binary_id')
})
this.schema.dropTable('part_conflicts')
}
}