Delete and rebuild table oc_systemtag_object_mapping

As described here I have a corrupt table which I cannot repair.

Table name is

nextcloud.oc_systemtag_object_mapping

Can I somehow delete the table and let it be rebuild?
I tried

occ recognize:reset-tags

But it does not do anything, even after hours.
Trying to select everything from the table leads to an error:

ERROR 1034 (HY000): Index for table ‘oc_systemtag_object_mapping’ is corrupt; try to repair it

There is another error in the logs of the db, but I think its not relevant:

2024-08-08 13:13:29 793 [ERROR] Incorrect definition of table mysql.column_stats: expected column 'histogram' at position 10 to have type longblob, found type varbinary(255).
2024-08-08 13:13:29 793 [ERROR] Incorrect definition of table mysql.column_stats: expected column 'hist_type' at position 9 to have type enum('SINGLE_PREC_HB','DOUBLE_PREC_HB','JSON_HB'), found type enum('SINGLE_PREC_HB','DOUBLE_PREC_HB').
2024-08-08 13:13:29 793 [ERROR] Incorrect definition of table mysql.column_stats: expected column 'histogram' at position 10 to have type longblob, found type varbinary(255).

Had a look at the code, but I am not familiar with php. How do I build the table with php?
Can someone give me their db configuration?

if (!$schema->hasTable('systemtag_object_mapping')) {
	$table = $schema->createTable('systemtag_object_mapping');
	$table->addColumn('objectid', 'string', [
		'notnull' => true,
		'length' => 64,
		'default' => '',
	]);
	$table->addColumn('objecttype', 'string', [
		'notnull' => true,
		'length' => 64,
		'default' => '',
	]);
	$table->addColumn('systemtagid', 'integer', [
		'notnull' => true,
		'length' => 4,
		'default' => 0,
		'unsigned' => true,
	]);
	$table->setPrimaryKey(['objecttype', 'objectid', 'systemtagid'], 'som_pk');
	//			$table->addUniqueIndex(['objecttype', 'objectid', 'systemtagid'], 'mapping');
	$table->addIndex(['systemtagid', 'objecttype'], 'systag_by_tagid');
}
>

This is the mysql code I created from it. I am unsure how to create the index and can not find anything about it in php tutorials. Can someone jump in and tell me how to create the index properly?

CREATE table nextcloud.oc_systemtag_object_mapping (
    objectid VARCHAR(64) NOT NULL ,
    objecttype VARCHAR(64) NOT NULL,
	systemtagid INT,
	PRIMARY KEY(objecttype, objectid, systemtagid)
); 

CREATE INDEX ??? ON nextcloud.oc_systemtag_object_mapping(???)

I have just created the table with the code

CREATE table nextcloud.oc_systemtag_object_mapping (
    objectid VARCHAR(64) NOT NULL ,
    objecttype VARCHAR(64) NOT NULL,
	systemtagid INT,
	PRIMARY KEY(objecttype, objectid, systemtagid)
); 

and then let the repair routine do its job.

By the way:

  • Re-installing the recognize app did not help
  • Repair routine solely did not add the table

This topic was automatically closed 8 days after the last reply. New replies are no longer allowed.