Merge pull request #166 from mamarley/hashversionmigrationfix
authorManuel Nickschas <sputnick@quassel-irc.org>
Sat, 2 Jan 2016 15:35:01 +0000 (16:35 +0100)
committerManuel Nickschas <sputnick@quassel-irc.org>
Sat, 2 Jan 2016 15:35:01 +0000 (16:35 +0100)
Fix migration of hashversion

src/core/SQL/PostgreSQL/17/migrate_write_quasseluser.sql
src/core/SQL/SQLite/18/migrate_read_quasseluser.sql
src/core/abstractsqlstorage.h
src/core/postgresqlstorage.cpp
src/core/sqlitestorage.cpp

index ae18c22..6b2f75c 100644 (file)
@@ -1,2 +1,2 @@
-INSERT INTO quasseluser (userid, username, password)
-VALUES (?, ?, ?)
+INSERT INTO quasseluser (userid, username, password, hashversion)
+VALUES (?, ?, ?, ?)
index 5adf0d9..210620e 100644 (file)
@@ -1,2 +1,2 @@
-SELECT userid, username, password
+SELECT userid, username, password, hashversion
 FROM quasseluser
index c39e826..0637d0e 100644 (file)
@@ -131,6 +131,7 @@ public:
         UserId id;
         QString username;
         QString password;
+        int hashversion;
     };
 
     struct SenderMO {
index 65460df..acb7f37 100644 (file)
@@ -1841,6 +1841,7 @@ bool PostgreSqlMigrationWriter::writeMo(const QuasselUserMO &user)
     bindValue(0, user.id.toInt());
     bindValue(1, user.username);
     bindValue(2, user.password);
+    bindValue(3, user.hashversion);
     return exec();
 }
 
index 354b340..e71c537 100644 (file)
@@ -1808,6 +1808,7 @@ bool SqliteMigrationReader::readMo(QuasselUserMO &user)
     user.id = value(0).toInt();
     user.username = value(1).toString();
     user.password = value(2).toString();
+    user.hashversion = value(3).toInt();
     return true;
 }