From 5b9ce296cb99a54c5d2c5254c64154271b933917 Mon Sep 17 00:00:00 2001 From: shennetsind Date: Fri, 15 Nov 2013 03:23:17 -0200 Subject: Modified db2sql plugin to maintain item_db2.sql makes it easier to keep the table structure up to date Signed-off-by: shennetsind --- src/plugins/db2sql.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/plugins/db2sql.c b/src/plugins/db2sql.c index e1ab26f30..47c85c2f0 100644 --- a/src/plugins/db2sql.c +++ b/src/plugins/db2sql.c @@ -155,6 +155,19 @@ void do_db2sql(void) { fclose(tosql.fp); + if ((tosql.fp = fopen("sql-files/item_db2.sql", "wt+")) == NULL) { + ShowError("itemdb_tosql: File not found \"%s\".\n", "sql-files/item_db2.sql"); + return; + } + + tosql.db_name = map->item_db2_db; + totable(); + + itemdb->clear(false); + itemdb->readdb("item_db2.conf"); + + fclose(tosql.fp); + /* unlink */ itemdb->readdb_libconfig_sub = itemdb_readdb_libconfig_sub; -- cgit v1.2.3-70-g09d2