aboutsummaryrefslogtreecommitdiffstats
path: root/lib/private/DB/SQLiteMigrator.php
diff options
context:
space:
mode:
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