Skip to content

Commit 1dddabb

Browse files
fix(archiving): compare share node type as string in data migration
tables_shares stores node_type as a string ('table'), so filtering with the integer NODE_TYPE_TABLE constant never matched the direct user shares (or, on MySQL loose casting, matched every node type). Recipient archive records were therefore not migrated correctly. Assisted-by: ClaudeCode:claude-fable-5 Signed-off-by: Andy Scherzinger <info@andy-scherzinger.de>
1 parent 2603a4a commit 1dddabb

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

lib/Migration/Version2400Date20260904000000.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313

1414
use Closure;
1515
use OCA\Tables\AppInfo\Application;
16+
use OCA\Tables\Helper\ConversionHelper;
1617
use OCP\DB\Exception;
1718
use OCP\DB\ISchemaWrapper;
1819
use OCP\DB\QueryBuilder\IQueryBuilder;
@@ -132,7 +133,7 @@ public function postSchemaChange(IOutput $output, Closure $schemaClosure, array
132133
$shareQb->select('receiver')
133134
->from('tables_shares')
134135
->where($shareQb->expr()->eq('node_id', $shareQb->createParameter('nodeId')))
135-
->andWhere($shareQb->expr()->eq('node_type', $shareQb->createNamedParameter(Application::NODE_TYPE_TABLE, IQueryBuilder::PARAM_INT)))
136+
->andWhere($shareQb->expr()->eq('node_type', $shareQb->createNamedParameter(ConversionHelper::constNodeType2String(Application::NODE_TYPE_TABLE))))
136137
->andWhere($shareQb->expr()->eq('receiver_type', $shareQb->createNamedParameter('user')));
137138

138139
$checkQb = $this->connection->getQueryBuilder();

0 commit comments

Comments
 (0)