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, 7 insertions, 30 deletions
diff --git a/lib/private/DB/SQLiteMigrator.php b/lib/private/DB/SQLiteMigrator.php
index 2be3591afdc..6be17625476 100644
--- a/lib/private/DB/SQLiteMigrator.php
+++ b/lib/private/DB/SQLiteMigrator.php
@@ -1,31 +1,13 @@
<?php
+
/**
- * @copyright Copyright (c) 2016, ownCloud, Inc.
- *
- * @author Robin Appelman <robin@icewind.nl>
- * @author Thomas Müller <thomas.mueller@tmit.eu>
- * @author Victor Dubiniuk <dubiniuk@owncloud.com>
- *
- * @license AGPL-3.0
- *
- * This code is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License, version 3,
- * as published by the Free Software Foundation.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License, version 3,
- * along with this program. If not, see <http://www.gnu.org/licenses/>
- *
+ * SPDX-FileCopyrightText: 2016-2024 Nextcloud GmbH and Nextcloud contributors
+ * SPDX-FileCopyrightText: 2016 ownCloud, Inc.
+ * SPDX-License-Identifier: AGPL-3.0-only
*/
namespace OC\DB;
use Doctrine\DBAL\Schema\Schema;
-use Doctrine\DBAL\Types\BigIntType;
-use Doctrine\DBAL\Types\Type;
class SQLiteMigrator extends Migrator {
/**
@@ -34,16 +16,11 @@ class SQLiteMigrator extends Migrator {
* @return \Doctrine\DBAL\Schema\SchemaDiff
*/
protected function getDiff(Schema $targetSchema, \Doctrine\DBAL\Connection $connection) {
- $platform = $connection->getDatabasePlatform();
- $platform->registerDoctrineTypeMapping('tinyint unsigned', 'integer');
- $platform->registerDoctrineTypeMapping('smallint unsigned', 'integer');
- $platform->registerDoctrineTypeMapping('varchar ', 'string');
-
- // with sqlite autoincrement columns is of type integer
foreach ($targetSchema->getTables() as $table) {
foreach ($table->getColumns() as $column) {
- if ($column->getType() instanceof BigIntType && $column->getAutoincrement()) {
- $column->setType(Type::getType('integer'));
+ // column comments are not supported on SQLite
+ if ($column->getComment() !== null) {
+ $column->setComment(null);
}
}
}