mirror of
https://github.com/nextcloud/android.git
synced 2024-11-21 20:55:31 +03:00
upon update reset capabilities
Signed-off-by: tobiasKaminsky <tobias@kaminsky.me>
This commit is contained in:
parent
eec7e2c7a7
commit
01cc5c72c8
5 changed files with 1188 additions and 1 deletions
1143
app/schemas/com.nextcloud.client.database.NextcloudDatabase/71.json
Normal file
1143
app/schemas/com.nextcloud.client.database.NextcloudDatabase/71.json
Normal file
File diff suppressed because it is too large
Load diff
|
@ -41,6 +41,7 @@ import com.nextcloud.client.database.entity.SyncedFolderEntity
|
|||
import com.nextcloud.client.database.entity.UploadEntity
|
||||
import com.nextcloud.client.database.entity.VirtualEntity
|
||||
import com.nextcloud.client.database.migrations.Migration67to68
|
||||
import com.nextcloud.client.database.migrations.Migration70to71
|
||||
import com.nextcloud.client.database.migrations.RoomMigration
|
||||
import com.nextcloud.client.database.migrations.addLegacyMigrations
|
||||
import com.owncloud.android.db.ProviderMeta
|
||||
|
@ -92,6 +93,7 @@ abstract class NextcloudDatabase : RoomDatabase() {
|
|||
.addLegacyMigrations(clock)
|
||||
.addMigrations(RoomMigration())
|
||||
.addMigrations(Migration67to68())
|
||||
.addMigrations(Migration70to71())
|
||||
.fallbackToDestructiveMigration()
|
||||
.build()
|
||||
}
|
||||
|
|
|
@ -53,6 +53,10 @@ object DatabaseMigrationUtil {
|
|||
replaceTable(database, tableName, newTableTempName)
|
||||
}
|
||||
|
||||
fun resetCapabilities(database: SupportSQLiteDatabase) {
|
||||
database.execSQL("UPDATE capabilities SET etag = '' WHERE 1=1")
|
||||
}
|
||||
|
||||
/**
|
||||
* Utility method to create a new table with the given columns
|
||||
*/
|
||||
|
|
|
@ -0,0 +1,38 @@
|
|||
/*
|
||||
* Nextcloud Android client application
|
||||
*
|
||||
* @author Álvaro Brey
|
||||
* Copyright (C) 2023 Álvaro Brey
|
||||
* Copyright (C) 2023 Nextcloud GmbH
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 3 of the License, or any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU AFFERO GENERAL PUBLIC LICENSE for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Affero General Public
|
||||
* License along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
*/
|
||||
|
||||
package com.nextcloud.client.database.migrations
|
||||
|
||||
import androidx.room.migration.Migration
|
||||
import androidx.sqlite.db.SupportSQLiteDatabase
|
||||
|
||||
/**
|
||||
* Migration from version 70 to 71.
|
||||
*
|
||||
* resets capabilities to show groupfolder
|
||||
*/
|
||||
@Suppress("MagicNumber")
|
||||
class Migration70to71 : Migration(70, 71) {
|
||||
override fun migrate(database: SupportSQLiteDatabase) {
|
||||
DatabaseMigrationUtil.resetCapabilities(database)
|
||||
}
|
||||
}
|
|
@ -35,7 +35,7 @@ import java.util.List;
|
|||
*/
|
||||
public class ProviderMeta {
|
||||
public static final String DB_NAME = "filelist";
|
||||
public static final int DB_VERSION = 70;
|
||||
public static final int DB_VERSION = 71;
|
||||
|
||||
private ProviderMeta() {
|
||||
// No instance
|
||||
|
|
Loading…
Reference in a new issue