mirror of
https://github.com/nextcloud/desktop.git
synced 2025-10-26 11:17:43 +00:00
refactor(syncjournaldb): refactor logic before updating the list of columns when removing one.
Signed-off-by: Camila Ayres <hello@camilasan.com>
This commit is contained in:
parent
0a320a5960
commit
cd2fc99497
@ -895,16 +895,20 @@ bool SyncJournalDb::updateMetadataTableStructure()
|
||||
const auto quotaBytesAvailable = QStringLiteral("quotaBytesAvailable");
|
||||
const auto defaultCommand = QStringLiteral("DEFAULT -1 NOT NULL");
|
||||
const auto bigInt = QStringLiteral("BIGINT");
|
||||
auto result = false;
|
||||
|
||||
if (columnExists(quotaBytesUsed) && !hasDefaultValue(quotaBytesUsed)) {
|
||||
re = removeColumn(quotaBytesUsed);
|
||||
result = removeColumn(quotaBytesUsed);
|
||||
}
|
||||
|
||||
if (columnExists(quotaBytesAvailable) && !hasDefaultValue(quotaBytesAvailable)) {
|
||||
re = removeColumn(quotaBytesAvailable);
|
||||
result = removeColumn(quotaBytesAvailable);
|
||||
}
|
||||
|
||||
if (result) {
|
||||
columns = tableColumns("metadata");
|
||||
}
|
||||
|
||||
columns = tableColumns("metadata");
|
||||
addColumn(quotaBytesUsed, bigInt, false, defaultCommand);
|
||||
addColumn(quotaBytesAvailable, bigInt, false, defaultCommand);
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user