2014-03-27 13:44:19 +00:00
|
|
|
<?php
|
2024-05-23 07:26:56 +00:00
|
|
|
|
2014-03-27 13:44:19 +00:00
|
|
|
/**
|
2024-05-23 07:26:56 +00:00
|
|
|
* SPDX-FileCopyrightText: 2016-2024 Nextcloud GmbH and Nextcloud contributors
|
|
|
|
* SPDX-FileCopyrightText: 2016 ownCloud, Inc.
|
|
|
|
* SPDX-License-Identifier: AGPL-3.0-only
|
2014-03-27 13:44:19 +00:00
|
|
|
*/
|
|
|
|
namespace OC\DB;
|
|
|
|
|
2014-07-25 06:46:43 +00:00
|
|
|
use Doctrine\DBAL\Schema\Schema;
|
2014-03-27 13:44:19 +00:00
|
|
|
|
|
|
|
class SQLiteMigrator extends Migrator {
|
2014-07-25 06:46:43 +00:00
|
|
|
/**
|
|
|
|
* @param Schema $targetSchema
|
|
|
|
* @param \Doctrine\DBAL\Connection $connection
|
|
|
|
* @return \Doctrine\DBAL\Schema\SchemaDiff
|
|
|
|
*/
|
|
|
|
protected function getDiff(Schema $targetSchema, \Doctrine\DBAL\Connection $connection) {
|
2016-06-29 12:54:41 +00:00
|
|
|
foreach ($targetSchema->getTables() as $table) {
|
|
|
|
foreach ($table->getColumns() as $column) {
|
2023-02-21 23:58:08 +00:00
|
|
|
// column comments are not supported on SQLite
|
|
|
|
if ($column->getComment() !== null) {
|
|
|
|
$column->setComment(null);
|
|
|
|
}
|
2016-06-29 12:54:41 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2014-07-25 06:46:43 +00:00
|
|
|
return parent::getDiff($targetSchema, $connection);
|
|
|
|
}
|
2014-03-27 13:44:19 +00:00
|
|
|
}
|