summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorhorchi <vdr@jwendel.de>2017-03-19 15:26:57 +0100
committerhorchi <vdr@jwendel.de>2017-03-19 15:26:57 +0100
commit4ab12d84b2738fbfc9aafed6b4710180aa2d37e4 (patch)
treeca3e6cf76e14ab4af4f6655dc8f764fb1e927a8d /lib
parent4c2906c0ee6947cd8c04e36820e62e2e00fbc868 (diff)
downloadvdr-epg-daemon-4ab12d84b2738fbfc9aafed6b4710180aa2d37e4.tar.gz
vdr-epg-daemon-4ab12d84b2738fbfc9aafed6b4710180aa2d37e4.tar.bz2
minor imrovement of db api
Diffstat (limited to 'lib')
-rw-r--r--lib/db.c15
1 files changed, 9 insertions, 6 deletions
diff --git a/lib/db.c b/lib/db.c
index 7b50bcd..2dbca80 100644
--- a/lib/db.c
+++ b/lib/db.c
@@ -734,15 +734,18 @@ int cDbTable::init(int allowAlter)
// check/create table ...
- if (exist() && allowAlter)
- validateStructure(allowAlter);
+ if (allowAlter)
+ {
+ if (exist())
+ validateStructure(allowAlter);
- if (createTable() != success)
- return fail;
+ if (!exist() && createTable() != success)
+ return fail;
- // check/create indices
+ // check/create indices
- createIndices();
+ createIndices();
+ }
// ------------------------------
// prepare BASIC statements