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:
Daan MeijerandClaude Opus 5.5 committed 2026-10-09 00:19:00 +02:00
1 parent a18ead666b
commit 2209921846
11 files changed
+1228

No files matched your search

@@ -0,0 +1,30 @@
import { BaseSchema } from '@adonisjs/lucid/schema'
/** Edge workers and their API tokens (the `node` guard). */
export default class extends BaseSchema {
async up() {
this.schema.createTable('nodes', (table) => {
table.increments('id')
table.string('name', 64).notNullable().unique()
table.timestamp('last_seen_at', { useTz: true }).nullable()
table.timestamp('created_at', { useTz: true }).notNullable().defaultTo(this.now())
})
this.schema.createTable('node_access_tokens', (table) => {
table.increments('id')
table.integer('tokenable_id').notNullable().unsigned().references('id').inTable('nodes').onDelete('CASCADE')
table.string('type').notNullable()
table.string('name').nullable()
table.string('hash').notNullable()
table.text('abilities').notNullable()
table.timestamp('created_at')
table.timestamp('updated_at')
table.timestamp('last_used_at').nullable()
table.timestamp('expires_at').nullable()
})
}
async down() {
this.schema.dropTable('node_access_tokens')
this.schema.dropTable('nodes')
}
}