36 lines
1.2 KiB
TypeScript
36 lines
1.2 KiB
TypeScript
import { BaseSchema } from '@adonisjs/lucid/schema'
|
|
|
|
/**
|
|
* What the rules dropped, per range (REBUILD.md, rules and recovery), and
|
|
* the sample of it kept in full.
|
|
*/
|
|
export default class extends BaseSchema {
|
|
async up() {
|
|
this.schema.createTable('rule_counts', (table) => {
|
|
table.bigInteger('range_id').notNullable()
|
|
table.string('rule', 12).notNullable()
|
|
table.text('key').notNullable()
|
|
table.bigInteger('articles').notNullable().defaultTo(0)
|
|
table.bigInteger('files').notNullable().defaultTo(0)
|
|
table.primary(['range_id', 'rule', 'key'])
|
|
})
|
|
this.schema.createTable('rule_samples', (table) => {
|
|
table.bigIncrements('id')
|
|
table.bigInteger('range_id').notNullable()
|
|
table.string('rule', 12).notNullable()
|
|
table.text('rule_key').notNullable()
|
|
table.string('release_key', 40).notNullable()
|
|
table.text('name').notNullable()
|
|
table.integer('files').notNullable()
|
|
table.integer('segments').notNullable()
|
|
table.binary('payload').notNullable()
|
|
table.index(['rule', 'rule_key'])
|
|
})
|
|
}
|
|
|
|
async down() {
|
|
this.schema.dropTable('rule_samples')
|
|
this.schema.dropTable('rule_counts')
|
|
}
|
|
}
|