dbhub: Change schema of local database

Also delete the upgrade mechanism that was put in place because it won't
be that easy anyway later on.
This commit is contained in:
Martin Kleusberg
2017-09-30 13:02:18 +02:00
parent fef884a4e1
commit f18064f0ae

View File

@@ -518,7 +518,7 @@ void RemoteDatabase::localAssureOpened()
"\"name\" TEXT NOT NULL,"
"\"url\" TEXT NOT NULL,"
"\"commit_id\" TEXT NOT NULL,"
"\"file\" INTEGER,"
"\"file\" TEXT NOT NULL UNIQUE,"
"\"modified\" INTEGER DEFAULT 0,"
"\"branch\" TEXT NOT NULL DEFAULT \"master\""
")");
@@ -530,12 +530,6 @@ void RemoteDatabase::localAssureOpened()
m_dbLocal = nullptr;
return;
}
// Add column "branch" if it doesn't exist yet. This isn't done in a particular nice way here because we just let the
// command fail if it already exists but whatever.
// NOTE that this code can be removed after releasing v3.11.0.
statement = QString("ALTER TABLE \"local\" ADD COLUMN \"branch\" TEXT NOT NULL DEFAULT \"master\"");
sqlite3_exec(m_dbLocal, statement.toUtf8(), NULL, NULL, NULL);
}
void RemoteDatabase::localAdd(QString filename, QString identity, const QUrl& url)