fase(15): reporting module with pdf generation
This commit is contained in:
25
dist/db/migrations/005_reports_table.js
vendored
Normal file
25
dist/db/migrations/005_reports_table.js
vendored
Normal file
@@ -0,0 +1,25 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.up = up;
|
||||
exports.down = down;
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
async function up(db) {
|
||||
await db.schema
|
||||
.createTable('reports')
|
||||
.ifNotExists()
|
||||
.addColumn('id', 'text', (col) => col.primaryKey())
|
||||
.addColumn('title', 'text', (col) => col.notNull())
|
||||
.addColumn('format', 'text', (col) => col.notNull())
|
||||
.addColumn('status', 'text', (col) => col.notNull().defaultTo('pending'))
|
||||
.addColumn('filters_json', 'text', (col) => col.notNull().defaultTo('{}'))
|
||||
.addColumn('file_path', 'text')
|
||||
.addColumn('error_message', 'text')
|
||||
.addColumn('total_findings', 'integer', (col) => col.notNull().defaultTo(0))
|
||||
.addColumn('created_at', 'integer', (col) => col.notNull())
|
||||
.addColumn('completed_at', 'integer')
|
||||
.execute();
|
||||
}
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
async function down(db) {
|
||||
await db.schema.dropTable('reports').ifExists().execute();
|
||||
}
|
||||
Reference in New Issue
Block a user