mirror of
https://gitlab.linphone.org/BC/public/linphone-iphone.git
synced 2026-05-07 05:53:06 +00:00
feat(MainDb): add new table db_module_version
This commit is contained in:
parent
e1f4254dc1
commit
28944e466e
5 changed files with 24 additions and 11 deletions
|
|
@ -6003,8 +6003,6 @@ void _linphone_core_uninit(LinphoneCore *lc)
|
|||
ms_usleep(10000);
|
||||
}
|
||||
|
||||
lc->chat_rooms = bctbx_list_free_with_data(lc->chat_rooms, (bctbx_list_free_func)linphone_chat_room_unref);
|
||||
|
||||
linphone_core_set_state(lc,LinphoneGlobalShutdown,"Shutting down");
|
||||
#ifdef VIDEO_ENABLED
|
||||
if (lc->previewstream!=NULL){
|
||||
|
|
|
|||
|
|
@ -612,12 +612,7 @@ void CallSessionPrivate::setReleased () {
|
|||
}
|
||||
referer = nullptr;
|
||||
transferTarget = nullptr;
|
||||
#if 0
|
||||
if (call->chat_room){
|
||||
linphone_chat_room_unref(call->chat_room);
|
||||
call->chat_room = NULL;
|
||||
}
|
||||
#endif
|
||||
|
||||
if (listener)
|
||||
listener->onCallSessionSetReleased(q->getSharedFromThis());
|
||||
}
|
||||
|
|
|
|||
|
|
@ -25,6 +25,8 @@
|
|||
#include <TargetConditionals.h>
|
||||
#endif // ifdef __APPLE__
|
||||
|
||||
#include "linphone/utils/utils.h"
|
||||
|
||||
#include "abstract-db-p.h"
|
||||
#include "db/session/db-session-provider.h"
|
||||
#include "logger/logger.h"
|
||||
|
|
@ -123,6 +125,20 @@ string AbstractDb::primaryKeyRefStr (const string &type) const {
|
|||
return "";
|
||||
}
|
||||
|
||||
string AbstractDb::varcharPrimaryKeyStr (int length) const {
|
||||
L_D();
|
||||
|
||||
switch (d->backend) {
|
||||
case Mysql:
|
||||
return " VARCHAR(" + Utils::toString(length) + ") AUTO_INCREMENT PRIMARY KEY";
|
||||
case Sqlite3:
|
||||
return " VARCHAR(" + Utils::toString(length) + ") PRIMARY KEY";
|
||||
}
|
||||
|
||||
L_ASSERT(false);
|
||||
return "";
|
||||
}
|
||||
|
||||
string AbstractDb::timestampType () const {
|
||||
L_D();
|
||||
|
||||
|
|
@ -165,9 +181,6 @@ long long AbstractDb::getLastInsertId () const {
|
|||
case Sqlite3:
|
||||
sql = "SELECT last_insert_rowid()";
|
||||
break;
|
||||
default:
|
||||
lWarning() << "Unsupported backend.";
|
||||
return -1;
|
||||
}
|
||||
|
||||
soci::session *session = d->dbSession.getBackendSession<soci::session>();
|
||||
|
|
|
|||
|
|
@ -53,6 +53,7 @@ protected:
|
|||
|
||||
std::string primaryKeyStr (const std::string &type = "INT") const;
|
||||
std::string primaryKeyRefStr (const std::string &type = "INT") const;
|
||||
std::string varcharPrimaryKeyStr (int length) const;
|
||||
|
||||
std::string timestampType () const;
|
||||
|
||||
|
|
|
|||
|
|
@ -1304,6 +1304,12 @@ static constexpr string &blobToString (string &in) {
|
|||
|
||||
*session << participantMessageDeleter;
|
||||
#endif
|
||||
|
||||
*session <<
|
||||
"CREATE TABLE IF NOT EXISTS db_module_version ("
|
||||
" name" + varcharPrimaryKeyStr(16) + ","
|
||||
" version INT UNSIGNED NOT NULL"
|
||||
") " + charset;
|
||||
}
|
||||
|
||||
bool MainDb::addEvent (const shared_ptr<EventLog> &eventLog) {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue