Skip to content

Commit

Permalink
fix: apply migration only for pg and sqlite
Browse files Browse the repository at this point in the history
  • Loading branch information
IljaN committed May 7, 2024
1 parent e3c9467 commit 1b5c5fa
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion core/Migrations/Version20240507143125.php
Original file line number Diff line number Diff line change
@@ -1,12 +1,19 @@
<?php
namespace OC\Migrations;

use Doctrine\DBAL\Platforms\PostgreSqlPlatform;
use Doctrine\DBAL\Platforms\SqlitePlatform;
use OCP\IDBConnection;
use OCP\Migration\ISqlMigration;

class Version20240507143125 implements ISqlMigration {
public function sql(IDBConnection $connection) {
return ["CREATE UNIQUE INDEX child_share_unique ON oc_share (share_with, parent)
$dbPlatform = $connection->getDatabasePlatform();
if ($dbPlatform instanceof PostgreSqlPlatform || $dbPlatform instanceof SqlitePlatform) {
return ["CREATE UNIQUE INDEX child_share_unique ON oc_share (share_with, parent)
WHERE parent IS NOT NULL AND share_type = 2"];
}

return [];
}
}

0 comments on commit 1b5c5fa

Please sign in to comment.