diff options
Diffstat (limited to 'lib/db.c')
-rw-r--r-- | lib/db.c | 15 |
1 files changed, 9 insertions, 6 deletions
@@ -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 |