Create the table & set the initial values
| 51 | // Create the table & set the initial values |
| 52 | //******************************************** |
| 53 | void ConfigStore::createTable() { |
| 54 | QLOG_TRACE() << "Entering ConfigStore::createTable()"; |
| 55 | |
| 56 | QLOG_DEBUG() << "Creating table ConfigStore"; |
| 57 | NSqlQuery sql(db); |
| 58 | |
| 59 | db->lockForWrite(); |
| 60 | // build the SQL command & cretae the table |
| 61 | QString command("Create table if not exists ConfigStore (" + |
| 62 | QString("key integer primary key not null unique,") + |
| 63 | QString("value blob)")); |
| 64 | if (!sql.exec(command)) { |
| 65 | QLOG_ERROR() << "Creation of ConfigStore table failed: " << sql.lastError(); |
| 66 | sql.finish(); |
| 67 | db->unlock(); |
| 68 | } else { |
| 69 | // insert default values into the new table |
| 70 | this->initTable(); |
| 71 | sql.finish(); |
| 72 | db->unlock(); |
| 73 | } |
| 74 | } |
| 75 | |
| 76 | |
| 77 |
no test coverage detected