Fix SQLite -> Postgres migration
authorManuel Nickschas <sputnick@quassel-irc.org>
Sun, 14 Feb 2010 21:40:44 +0000 (22:40 +0100)
committerManuel Nickschas <sputnick@quassel-irc.org>
Sun, 14 Feb 2010 21:40:44 +0000 (22:40 +0100)
src/common/network.cpp
src/core/SQL/SQLite/17/migrate_read_network.sql
src/core/abstractsqlstorage.h
src/core/postgresqlstorage.cpp
src/core/sqlitestorage.cpp

index 67ebe91..d7b2149 100644 (file)
@@ -574,21 +574,21 @@ void Network::setAutoIdentifyPassword(const QString &password) {
 }
 
 void Network::setUseSasl(bool use) {
 }
 
 void Network::setUseSasl(bool use) {
-    _useSasl = use;
-    SYNC(ARG(use))
-    emit configChanged();
+  _useSasl = use;
+  SYNC(ARG(use))
+  emit configChanged();
 }
 
 void Network::setSaslAccount(const QString &account) {
 }
 
 void Network::setSaslAccount(const QString &account) {
-    _saslAccount = account;
-    SYNC(ARG(account))
-    emit configChanged();
+  _saslAccount = account;
+  SYNC(ARG(account))
+  emit configChanged();
 }
 
 void Network::setSaslPassword(const QString &password) {
 }
 
 void Network::setSaslPassword(const QString &password) {
-    _saslPassword = password;
-    SYNC(ARG(password))
-    emit configChanged();
+  _saslPassword = password;
+  SYNC(ARG(password))
+  emit configChanged();
 }
 
 void Network::setUseAutoReconnect(bool use) {
 }
 
 void Network::setUseAutoReconnect(bool use) {
index 1308d80..52cdc67 100644 (file)
@@ -1,5 +1,6 @@
 SELECT networkid, userid, networkname, identityid, encodingcodec, decodingcodec, servercodec,
        userandomserver, perform, useautoidentify, autoidentifyservice, autoidentifypassword,
        useautoreconnect, autoreconnectinterval, autoreconnectretries, unlimitedconnectretries,
 SELECT networkid, userid, networkname, identityid, encodingcodec, decodingcodec, servercodec,
        userandomserver, perform, useautoidentify, autoidentifyservice, autoidentifypassword,
        useautoreconnect, autoreconnectinterval, autoreconnectretries, unlimitedconnectretries,
-       rejoinchannels, connected, usermode, awaymessage, attachperform, detachperform
+       rejoinchannels, connected, usermode, awaymessage, attachperform, detachperform,
+       usesasl, saslaccount, saslpassword
 FROM network
 FROM network
index 8990551..0367a55 100644 (file)
@@ -187,6 +187,9 @@ public:
     QString awaymessage;
     QString attachperform;
     QString detachperform;
     QString awaymessage;
     QString attachperform;
     QString detachperform;
+    bool usesasl;
+    QString saslaccount;
+    QString saslpassword;
   };
 
   struct BufferMO {
   };
 
   struct BufferMO {
index c942b4a..0ae2d6d 100644 (file)
@@ -1660,6 +1660,9 @@ bool PostgreSqlMigrationWriter::writeMo(const NetworkMO &network) {
   bindValue(19, network.awaymessage);
   bindValue(20, network.attachperform);
   bindValue(21, network.detachperform);
   bindValue(19, network.awaymessage);
   bindValue(20, network.attachperform);
   bindValue(21, network.detachperform);
+  bindValue(22, network.usesasl);
+  bindValue(23, network.saslaccount);
+  bindValue(24, network.saslpassword);
   return exec();
 }
 
   return exec();
 }
 
index c962e8f..5f36e83 100644 (file)
@@ -1736,6 +1736,9 @@ bool SqliteMigrationReader::readMo(NetworkMO &network) {
   network.awaymessage = value(19).toString();
   network.attachperform = value(20).toString();
   network.detachperform = value(21).toString();
   network.awaymessage = value(19).toString();
   network.attachperform = value(20).toString();
   network.detachperform = value(21).toString();
+  network.usesasl = value(22).toInt() == 1 ? true : false;
+  network.saslaccount = value(23).toString();
+  network.saslpassword = value(24).toString();
   return true;
 }
 
   return true;
 }