Skip to content

Commit

Permalink
Add missing result_trash score column
Browse files Browse the repository at this point in the history
  • Loading branch information
mattmundell committed Oct 21, 2020
1 parent 0afb4d1 commit 6d82b04
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 2 deletions.
3 changes: 3 additions & 0 deletions src/manage_migrators.c
Original file line number Diff line number Diff line change
Expand Up @@ -2484,6 +2484,9 @@ migrate_237_to_238 ()
sql ("ALTER TABLE results ADD column score integer;");
sql ("UPDATE results SET score = (severity::float * 10)::integer;");

sql ("ALTER TABLE results_trash ADD column score integer;");
sql ("UPDATE results_trash SET score = (severity::float * 10)::integer;");

/* Set the database version to 238. */

set_db_version (238);
Expand Down
1 change: 1 addition & 0 deletions src/manage_pg.c
Original file line number Diff line number Diff line change
Expand Up @@ -2376,6 +2376,7 @@ create_tables ()
" report integer REFERENCES reports (id) ON DELETE RESTRICT,"
" nvt_version text,"
" severity real,"
" score integer,"
" qod integer,"
" qod_type text,"
" owner integer REFERENCES users (id) ON DELETE RESTRICT,"
Expand Down
4 changes: 2 additions & 2 deletions src/manage_sql.c
Original file line number Diff line number Diff line change
Expand Up @@ -29454,7 +29454,7 @@ delete_task (task_t task, int ultimate)
" report, nvt_version, severity, score, qod, qod_type, owner, date,"
" hostname, path)"
" SELECT uuid, task, host, port, nvt, result_nvt, type,"
" description, report, nvt_version, severity, qod,"
" description, report, nvt_version, severity, score, qod,"
" qod_type, owner, date, hostname, path"
" FROM results"
" WHERE report IN (SELECT id FROM reports WHERE task = %llu);",
Expand Down Expand Up @@ -46302,7 +46302,7 @@ manage_restore (const char *id)
" report, nvt_version, severity, score, qod, qod_type, owner, date,"
" hostname, path)"
" SELECT uuid, task, host, port, nvt, result_nvt, type,"
" description, report, nvt_version, severity, qod,"
" description, report, nvt_version, severity, score, qod,"
" qod_type, owner, date, hostname, path"
" FROM results_trash"
" WHERE report IN (SELECT id FROM reports WHERE task = %llu);",
Expand Down

0 comments on commit 6d82b04

Please sign in to comment.