After updating to nextcloud 15.0.0 I get the following error:
Some indices are missing in the database. Because adding indexes to large tables may take some time, they have not been added automatically. By executing “occ db: add-missing-indices”, missing indexes can be added manually while the instance is running. Once the indexes have been added, queries to these tables are usually faster.
Fehlender Index “owner_index” in der Tabelle “oc_share”.
Fehlender Index “initiator_index” in der Tabelle “oc_share”.
Using a shared hosting I can not launch the occ command so I need the SQL-Command für PHPMyAdmin.
There is also a problem with a lot conversion to big int. Is there also a SQL-Command for this?
Well, not exactly. For activity.activity_id activity_mq.mail_id filecache.fileid mimetypes.id storages.numeric_id
as example the columns actually have “NULL” as default and are “auto_increment”.
So the query is rather like this:
ALTER TABLE oc_filecache MODIFY fileid bigint AUTO_INCREMENT PRIMARY KEY;
For the rest it should correct.
But: I’m not DB expert and not 100% sure about that. Definitely create a DB backup before you try anything.
with the following queries you can modify the database field type from int(11) to bigint(20):
ALTER TABLE `oc_filecache` MODIFY `fileid` bigint NOT NULL AUTO_INCREMENT;
ALTER TABLE `oc_filecache` MODIFY `storage` bigint NOT NULL DEFAULT '0';
ALTER TABLE `oc_filecache` MODIFY `parent` bigint NOT NULL DEFAULT '0';
ALTER TABLE `oc_filecache` MODIFY `mimetype` bigint NOT NULL DEFAULT '0';
ALTER TABLE `oc_filecache` MODIFY `mimepart` bigint NOT NULL DEFAULT '0';
ALTER TABLE `oc_filecache` MODIFY `mtime` bigint NOT NULL DEFAULT '0';
ALTER TABLE `oc_filecache` MODIFY `storage_mtime` bigint NOT NULL DEFAULT '0';
ALTER TABLE `oc_activity` MODIFY `activity_id` bigint NOT NULL AUTO_INCREMENT;
ALTER TABLE `oc_activity` MODIFY `object_id` bigint NOT NULL DEFAULT '0';
ALTER TABLE `oc_activity_mq` MODIFY `mail_id` bigint NOT NULL AUTO_INCREMENT;
ALTER TABLE `oc_storages` MODIFY `numeric_id` bigint NOT NULL AUTO_INCREMENT;
This will solve the “occ db: convert-filecache-bigint” part.
@Maurice what about the columns which are actually primary keys with default NULL and auto_increment? Shouldn’t they be treated differently? Does the alter table query you wrote leave the primary key and auto_increment definition leave untouched?