Rebuild: schema for groups, rule sets, ranges, release catalog, chunk store, fragments, probe queue, rule bookkeeping and nodes
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
a18ead666b
commit
2209921846
11 files changed
+1228
No files matched your search
@@ -0,0 +1,25 @@
|
||||
import { BaseSchema } from '@adonisjs/lucid/schema'
|
||||
|
||||
/**
|
||||
* The probe queue (REBUILD.md, part 6): per release the few articles phase 2
|
||||
* should read. Phase 1 only fills it.
|
||||
*/
|
||||
export default class extends BaseSchema {
|
||||
async up() {
|
||||
this.schema.createTable('probe_candidates', (table) => {
|
||||
table.bigIncrements('id')
|
||||
table.bigInteger('release_id').notNullable()
|
||||
table.string('kind', 8).notNullable()
|
||||
table.text('message_id').notNullable()
|
||||
table.text('file').notNullable()
|
||||
table.string('status', 8).notNullable().defaultTo('waiting')
|
||||
table.timestamp('created_at', { useTz: true }).notNullable().defaultTo(this.now())
|
||||
table.unique(['release_id', 'kind', 'message_id'])
|
||||
})
|
||||
this.schema.raw(`CREATE INDEX probe_candidates_waiting_idx ON probe_candidates (id) WHERE status = 'waiting'`)
|
||||
}
|
||||
|
||||
async down() {
|
||||
this.schema.dropTable('probe_candidates')
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user