mirror of
https://github.com/nextcloud/android.git
synced 2024-11-25 06:35:48 +03:00
migrate to 74 and reset capabilities
Signed-off-by: tobiasKaminsky <tobias@kaminsky.me>
This commit is contained in:
parent
3a6854b209
commit
200e2db1f3
4 changed files with 66 additions and 32 deletions
|
@ -1,18 +1,18 @@
|
||||||
{
|
{
|
||||||
"formatVersion": 1,
|
"formatVersion": 1,
|
||||||
"database": {
|
"database": {
|
||||||
"version": 74,
|
"version": 74,
|
||||||
"identityHash": "7e73c045ac6d52d6c7c1626eefbc21e9",
|
"identityHash": "bc3fbd9985959e167fdd38198dd480b5",
|
||||||
"entities": [
|
"entities": [
|
||||||
{
|
|
||||||
"tableName": "arbitrary_data",
|
|
||||||
"createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`_id` INTEGER PRIMARY KEY AUTOINCREMENT, `cloud_id` TEXT, `key` TEXT, `value` TEXT)",
|
|
||||||
"fields": [
|
|
||||||
{
|
{
|
||||||
"fieldPath": "id",
|
"tableName": "arbitrary_data",
|
||||||
"columnName": "_id",
|
"createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`_id` INTEGER PRIMARY KEY AUTOINCREMENT, `cloud_id` TEXT, `key` TEXT, `value` TEXT)",
|
||||||
"affinity": "INTEGER",
|
"fields": [
|
||||||
"notNull": false
|
{
|
||||||
|
"fieldPath": "id",
|
||||||
|
"columnName": "_id",
|
||||||
|
"affinity": "INTEGER",
|
||||||
|
"notNull": false
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"fieldPath": "cloudId",
|
"fieldPath": "cloudId",
|
||||||
|
@ -42,19 +42,19 @@
|
||||||
"indices": [],
|
"indices": [],
|
||||||
"foreignKeys": []
|
"foreignKeys": []
|
||||||
},
|
},
|
||||||
{
|
|
||||||
"tableName": "capabilities",
|
|
||||||
"createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`_id` INTEGER PRIMARY KEY AUTOINCREMENT, `account` TEXT, `version_mayor` INTEGER, `version_minor` INTEGER, `version_micro` INTEGER, `version_string` TEXT, `version_edition` TEXT, `extended_support` INTEGER, `core_pollinterval` INTEGER, `sharing_api_enabled` INTEGER, `sharing_public_enabled` INTEGER, `sharing_public_password_enforced` INTEGER, `sharing_public_expire_date_enabled` INTEGER, `sharing_public_expire_date_days` INTEGER, `sharing_public_expire_date_enforced` INTEGER, `sharing_public_send_mail` INTEGER, `sharing_public_upload` INTEGER, `sharing_user_send_mail` INTEGER, `sharing_resharing` INTEGER, `sharing_federation_outgoing` INTEGER, `sharing_federation_incoming` INTEGER, `files_bigfilechunking` INTEGER, `files_undelete` INTEGER, `files_versioning` INTEGER, `external_links` INTEGER, `server_name` TEXT, `server_color` TEXT, `server_text_color` TEXT, `server_element_color` TEXT, `server_slogan` TEXT, `server_logo` TEXT, `background_url` TEXT, `end_to_end_encryption` INTEGER, `end_to_end_encryption_keys_exist` INTEGER, `activity` INTEGER, `background_default` INTEGER, `background_plain` INTEGER, `richdocument` INTEGER, `richdocument_mimetype_list` TEXT, `richdocument_direct_editing` INTEGER, `richdocument_direct_templates` INTEGER, `richdocument_optional_mimetype_list` TEXT, `sharing_public_ask_for_optional_password` INTEGER, `richdocument_product_name` TEXT, `direct_editing_etag` TEXT, `user_status` INTEGER, `user_status_supports_emoji` INTEGER, `etag` TEXT, `files_locking_version` TEXT, `groupfolders` INTEGER, `drop_account` INTEGER)",
|
|
||||||
"fields": [
|
|
||||||
{
|
{
|
||||||
"fieldPath": "id",
|
"tableName": "capabilities",
|
||||||
"columnName": "_id",
|
"createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`_id` INTEGER PRIMARY KEY AUTOINCREMENT, `account` TEXT, `version_mayor` INTEGER, `version_minor` INTEGER, `version_micro` INTEGER, `version_string` TEXT, `version_edition` TEXT, `extended_support` INTEGER, `core_pollinterval` INTEGER, `sharing_api_enabled` INTEGER, `sharing_public_enabled` INTEGER, `sharing_public_password_enforced` INTEGER, `sharing_public_expire_date_enabled` INTEGER, `sharing_public_expire_date_days` INTEGER, `sharing_public_expire_date_enforced` INTEGER, `sharing_public_send_mail` INTEGER, `sharing_public_upload` INTEGER, `sharing_user_send_mail` INTEGER, `sharing_resharing` INTEGER, `sharing_federation_outgoing` INTEGER, `sharing_federation_incoming` INTEGER, `files_bigfilechunking` INTEGER, `files_undelete` INTEGER, `files_versioning` INTEGER, `external_links` INTEGER, `server_name` TEXT, `server_color` TEXT, `server_text_color` TEXT, `server_element_color` TEXT, `server_slogan` TEXT, `server_logo` TEXT, `background_url` TEXT, `end_to_end_encryption` INTEGER, `end_to_end_encryption_keys_exist` INTEGER, `activity` INTEGER, `background_default` INTEGER, `background_plain` INTEGER, `richdocument` INTEGER, `richdocument_mimetype_list` TEXT, `richdocument_direct_editing` INTEGER, `richdocument_direct_templates` INTEGER, `richdocument_optional_mimetype_list` TEXT, `sharing_public_ask_for_optional_password` INTEGER, `richdocument_product_name` TEXT, `direct_editing_etag` TEXT, `user_status` INTEGER, `user_status_supports_emoji` INTEGER, `etag` TEXT, `files_locking_version` TEXT, `groupfolders` INTEGER)",
|
||||||
"affinity": "INTEGER",
|
"fields": [
|
||||||
"notNull": false
|
{
|
||||||
},
|
"fieldPath": "id",
|
||||||
{
|
"columnName": "_id",
|
||||||
"fieldPath": "accountName",
|
"affinity": "INTEGER",
|
||||||
"columnName": "account",
|
"notNull": false
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"fieldPath": "accountName",
|
||||||
|
"columnName": "account",
|
||||||
"affinity": "TEXT",
|
"affinity": "TEXT",
|
||||||
"notNull": false
|
"notNull": false
|
||||||
},
|
},
|
||||||
|
@ -345,12 +345,6 @@
|
||||||
"columnName": "groupfolders",
|
"columnName": "groupfolders",
|
||||||
"affinity": "INTEGER",
|
"affinity": "INTEGER",
|
||||||
"notNull": false
|
"notNull": false
|
||||||
},
|
|
||||||
{
|
|
||||||
"fieldPath": "dropAccount",
|
|
||||||
"columnName": "drop_account",
|
|
||||||
"affinity": "INTEGER",
|
|
||||||
"notNull": false
|
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"primaryKey": {
|
"primaryKey": {
|
||||||
|
@ -1155,7 +1149,7 @@
|
||||||
"views": [],
|
"views": [],
|
||||||
"setupQueries": [
|
"setupQueries": [
|
||||||
"CREATE TABLE IF NOT EXISTS room_master_table (id INTEGER PRIMARY KEY,identity_hash TEXT)",
|
"CREATE TABLE IF NOT EXISTS room_master_table (id INTEGER PRIMARY KEY,identity_hash TEXT)",
|
||||||
"INSERT OR REPLACE INTO room_master_table (id,identity_hash) VALUES(42, '7e73c045ac6d52d6c7c1626eefbc21e9')"
|
"INSERT OR REPLACE INTO room_master_table (id,identity_hash) VALUES(42, 'bc3fbd9985959e167fdd38198dd480b5')"
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -42,6 +42,7 @@ import com.nextcloud.client.database.entity.UploadEntity
|
||||||
import com.nextcloud.client.database.entity.VirtualEntity
|
import com.nextcloud.client.database.entity.VirtualEntity
|
||||||
import com.nextcloud.client.database.migrations.Migration67to68
|
import com.nextcloud.client.database.migrations.Migration67to68
|
||||||
import com.nextcloud.client.database.migrations.Migration70to71
|
import com.nextcloud.client.database.migrations.Migration70to71
|
||||||
|
import com.nextcloud.client.database.migrations.Migration73to74
|
||||||
import com.nextcloud.client.database.migrations.RoomMigration
|
import com.nextcloud.client.database.migrations.RoomMigration
|
||||||
import com.nextcloud.client.database.migrations.addLegacyMigrations
|
import com.nextcloud.client.database.migrations.addLegacyMigrations
|
||||||
import com.owncloud.android.db.ProviderMeta
|
import com.owncloud.android.db.ProviderMeta
|
||||||
|
@ -96,6 +97,7 @@ abstract class NextcloudDatabase : RoomDatabase() {
|
||||||
.addMigrations(RoomMigration())
|
.addMigrations(RoomMigration())
|
||||||
.addMigrations(Migration67to68())
|
.addMigrations(Migration67to68())
|
||||||
.addMigrations(Migration70to71())
|
.addMigrations(Migration70to71())
|
||||||
|
.addMigrations(Migration73to74())
|
||||||
.fallbackToDestructiveMigration()
|
.fallbackToDestructiveMigration()
|
||||||
.build()
|
.build()
|
||||||
}
|
}
|
||||||
|
|
|
@ -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 73 to 74.
|
||||||
|
*
|
||||||
|
* resets capabilities to show groupfolder
|
||||||
|
*/
|
||||||
|
@Suppress("MagicNumber")
|
||||||
|
class Migration73to74 : Migration(73, 74) {
|
||||||
|
override fun migrate(database: SupportSQLiteDatabase) {
|
||||||
|
DatabaseMigrationUtil.resetCapabilities(database)
|
||||||
|
}
|
||||||
|
}
|
|
@ -35,7 +35,7 @@ import java.util.List;
|
||||||
*/
|
*/
|
||||||
public class ProviderMeta {
|
public class ProviderMeta {
|
||||||
public static final String DB_NAME = "filelist";
|
public static final String DB_NAME = "filelist";
|
||||||
public static final int DB_VERSION = 73;
|
public static final int DB_VERSION = 74;
|
||||||
|
|
||||||
private ProviderMeta() {
|
private ProviderMeta() {
|
||||||
// No instance
|
// No instance
|
||||||
|
|
Loading…
Reference in a new issue