aboutsummaryrefslogtreecommitdiffstats
path: root/lib/private/DB/SQLiteMigrator.php
diff options
context:
space:
mode:
authorChristoph Wurst <ChristophWurst@users.noreply.github.com>2021-01-08 14:58:43 +0100
committerGitHub <noreply@github.com>2021-01-08 14:58:43 +0100
commit81302f78e5cea60dc9064be8ed979d523ff84e18 (patch)
tree76e8d025c3003e718cf5e04105b782ba8aaa4891 /lib/private/DB/SQLiteMigrator.php
parentaeb32e1bc8f50d641e093589cc2f8c90da166768 (diff)
parent250f76a59cfc865e2a6bd36b690abeed3b529490 (diff)
downloadnextcloud-server-81302f78e5cea60dc9064be8ed979d523ff84e18.tar.gz
nextcloud-server-81302f78e5cea60dc9064be8ed979d523ff84e18.zip
Merge pull request #24948 from nextcloud/dependabot/composer/doctrine/dbal-3.0.0
Bump doctrine/dbal from 2.12.0 to 3.0.0
Diffstat (limited to 'lib/private/DB/SQLiteMigrator.php')
-rw-r--r--lib/private/DB/SQLiteMigrator.php37
1 files changed, 0 insertions, 37 deletions
diff --git a/lib/private/DB/SQLiteMigrator.php b/lib/private/DB/SQLiteMigrator.php
index 16f18be135e..24b6c02b31c 100644
--- a/lib/private/DB/SQLiteMigrator.php
+++ b/lib/private/DB/SQLiteMigrator.php
@@ -26,7 +26,6 @@
namespace OC\DB;
-use Doctrine\DBAL\DBALException;
use Doctrine\DBAL\Schema\Schema;
use Doctrine\DBAL\Types\BigIntType;
use Doctrine\DBAL\Types\Type;
@@ -34,42 +33,6 @@ use Doctrine\DBAL\Types\Type;
class SQLiteMigrator extends Migrator {
/**
- * @param \Doctrine\DBAL\Schema\Schema $targetSchema
- * @throws \OC\DB\MigrationException
- *
- * For sqlite we simple make a copy of the entire database, and test the migration on that
- */
- public function checkMigrate(\Doctrine\DBAL\Schema\Schema $targetSchema) {
- $dbFile = $this->connection->getDatabase();
- $tmpFile = $this->buildTempDatabase();
- copy($dbFile, $tmpFile);
-
- $connectionParams = [
- 'path' => $tmpFile,
- 'driver' => 'pdo_sqlite',
- ];
- $conn = \Doctrine\DBAL\DriverManager::getConnection($connectionParams);
- try {
- $this->applySchema($targetSchema, $conn);
- $conn->close();
- unlink($tmpFile);
- } catch (DBALException $e) {
- $conn->close();
- unlink($tmpFile);
- throw new MigrationException('', $e->getMessage());
- }
- }
-
- /**
- * @return string
- */
- private function buildTempDatabase() {
- $dataDir = $this->config->getSystemValue("datadirectory", \OC::$SERVERROOT . '/data');
- $tmpFile = uniqid("oc_");
- return "$dataDir/$tmpFile.db";
- }
-
- /**
* @param Schema $targetSchema
* @param \Doctrine\DBAL\Connection $connection
* @return \Doctrine\DBAL\Schema\SchemaDiff