Skip to content

Commit

Permalink
fix #112
Browse files Browse the repository at this point in the history
  • Loading branch information
eldertek committed Dec 29, 2024
1 parent 7c33e67 commit c638de2
Show file tree
Hide file tree
Showing 7 changed files with 63 additions and 5 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
## 1.5.1 - 2024-12-29
### Fixed
- Fix database installation issue on MariaDB/MySQL when column length exceeded maximum key length (3072 bytes)
- Reduce folder path column lengths to be compatible with all database configurations

## 1.5.0 - 2024-12-28
### Added
- Open folder/file in new window from duplicate details page
Expand Down
2 changes: 1 addition & 1 deletion appinfo/info.xml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
* 📊 **Aperçu & Simulation** - Visualisez ce qui serait supprimé avant d'agir
* 💼 **Traitement en Arrière-plan** - Tâches automatisées de recherche de doublons
]]></description>
<version>1.5.0</version>
<version>1.5.1</version>
<author>André Théo LAURET</author>

<namespace>DuplicateFinder</namespace>
Expand Down
2 changes: 1 addition & 1 deletion lib/Migration/Version0001Date20210508222200.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ public function changeSchema(IOutput $output, Closure $schemaClosure, array $opt
if ($table->hasColumn('path')) {
$pathColumn = $table->getColumn('path');
$pathColumn->setType(Type::getType(Types::STRING));
$pathColumn->setOptions(['length' => 4000]);
$pathColumn->setOptions(['length' => 768]);
}
return $schema;
}
Expand Down
2 changes: 1 addition & 1 deletion lib/Migration/Version0009Date20240116000000.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ public function changeSchema(IOutput $output, Closure $schemaClosure, array $opt
]);
$table->addColumn('folder_path', 'string', [
'notnull' => true,
'length' => 700,
'length' => 768,
]);
$table->addColumn('created_at', 'datetime', [
'notnull' => true,
Expand Down
2 changes: 1 addition & 1 deletion lib/Migration/Version1040Date20240101000000.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ public function changeSchema(IOutput $output, Closure $schemaClosure, array $opt
]);
$table->addColumn('folder_path', 'string', [
'notnull' => true,
'length' => 4000,
'length' => 768,
]);
$table->addColumn('created_at', 'datetime', [
'notnull' => true,
Expand Down
53 changes: 53 additions & 0 deletions lib/Migration/Version1050Date20241228000000.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
<?php

declare(strict_types=1);

namespace OCA\DuplicateFinder\Migration;

use Closure;
use OCP\DB\ISchemaWrapper;
use OCP\Migration\IOutput;
use OCP\Migration\SimpleMigrationStep;

class Version1050Date20241228000000 extends SimpleMigrationStep {
public function changeSchema(IOutput $output, Closure $schemaClosure, array $options) {
/** @var ISchemaWrapper $schema */
$schema = $schemaClosure();

// Fix df_excluded_folders table
if ($schema->hasTable('df_excluded_folders')) {
$table = $schema->getTable('df_excluded_folders');

// Drop the existing index
if ($table->hasIndex('df_excl_folders_unique')) {
$table->dropIndex('df_excl_folders_unique');
}

// Modify the folder_path column to use a shorter length
$folderPathColumn = $table->getColumn('folder_path');
$folderPathColumn->setLength(768);

// Recreate the index with the shorter column
$table->addUniqueIndex(['user_id', 'folder_path'], 'df_excl_folders_unique');
}

// Fix duplicatefinder_of table
if ($schema->hasTable('duplicatefinder_of')) {
$table = $schema->getTable('duplicatefinder_of');

// Drop the existing index
if ($table->hasIndex('df_folders_unique_idx')) {
$table->dropIndex('df_folders_unique_idx');
}

// Modify the folder_path column to use a shorter length
$folderPathColumn = $table->getColumn('folder_path');
$folderPathColumn->setLength(768);

// Recreate the index with the shorter column
$table->addUniqueIndex(['user_id', 'folder_path'], 'df_folders_unique_idx');
}

return $schema;
}
}
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "duplicatefinder",
"description": "Save some space by finding your duplicate files",
"version": "1.5.0",
"version": "1.5.1",
"author": "André Théo LAURET <andrelauret@eclipse-technology.eu>",
"contributors": [],
"bugs": {
Expand Down

0 comments on commit c638de2

Please sign in to comment.