diff options
author | shennetsind <ind@henn.et> | 2013-11-15 03:23:17 -0200 |
---|---|---|
committer | shennetsind <ind@henn.et> | 2013-11-15 03:23:17 -0200 |
commit | 5b9ce296cb99a54c5d2c5254c64154271b933917 (patch) | |
tree | 3d35ca2eeb159e248e0567c24f5aebb8866c4fcf /src | |
parent | 008a12832ed37818a835945dd55ffcb4f3862932 (diff) | |
download | hercules-5b9ce296cb99a54c5d2c5254c64154271b933917.tar.gz hercules-5b9ce296cb99a54c5d2c5254c64154271b933917.tar.bz2 hercules-5b9ce296cb99a54c5d2c5254c64154271b933917.tar.xz hercules-5b9ce296cb99a54c5d2c5254c64154271b933917.zip |
Modified db2sql plugin to maintain item_db2.sql
makes it easier to keep the table structure up to date
Signed-off-by: shennetsind <ind@henn.et>
Diffstat (limited to 'src')
-rw-r--r-- | src/plugins/db2sql.c | 13 |
1 files changed, 13 insertions, 0 deletions
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; |