Skip to content

Commit

Permalink
Simplify migrator for rev 210.
Browse files Browse the repository at this point in the history
  • Loading branch information
janowagner committed Jun 11, 2019
1 parent 905ef59 commit 2c08ea0
Showing 1 changed file with 4 additions and 24 deletions.
28 changes: 4 additions & 24 deletions src/manage_migrators.c
Original file line number Diff line number Diff line change
Expand Up @@ -1757,30 +1757,10 @@ migrate_209_to_210 ()

/* Update the database. */

/* Remove the fields "bid" and "xref" from table "nvts".
* This is done by dropping the entire table and
* unset the sync time stamps to force gvmd to refresh the content. */

sql ("DROP TABLE IF EXISTS nvts CASCADE;");

sql ("DELETE FROM meta where name = 'nvts_feed_version' OR name = 'nvts_check_time';");

sql ("CREATE TABLE IF NOT EXISTS nvts"
" (id SERIAL PRIMARY KEY,"
" uuid text UNIQUE NOT NULL,"
" oid text UNIQUE NOT NULL,"
" name text,"
" comment text,"
" cve text,"
" tag text,"
" category text,"
" family text,"
" cvss_base text,"
" creation_time integer,"
" modification_time integer,"
" solution_type text,"
" qod integer,"
" qod_type text);");
/* Remove the fields "bid" and "xref" from table "nvts". */

sql ("ALTER TABLE IF EXISTS nvts DROP COLUMN bid CASCADE;");
sql ("ALTER TABLE IF EXISTS nvts DROP COLUMN xref CASCADE;");

/* Set the database version to 210. */

Expand Down

0 comments on commit 2c08ea0

Please sign in to comment.