Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions developer_manual/app_publishing_maintenance/upgrade-guide.rst
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ Optimistically speaking, the database connection and the query builder should mo

Some (minor) breaking changes were inevitable. Here's the summary

* Many of the database connection methods have now a documented exception that can be thrown: ``\OCP\DB\Exception``. This also acts as a replacement for the removed ``\Doctrine\DBAL\DBALException``.
* ``$queryBuilder->execute()->fetch()`` only has one argument now (there were three previously)
* ``$queryBuilder->execute()->fetchColumn()`` has no more arguments and got also deprecated. Use ``fetchOne`` instead
* ``$queryBuilder->execute()->bindParam()`` was removed because conceptually it does not make sense to bind a parameter *after* executing a query. Use ``bindParam`` on the ``IPeparedStatement`` instead.
Expand All @@ -45,8 +46,8 @@ Some (minor) breaking changes were inevitable. Here's the summary
* ``$queryBuilder->execute()->errorCode()`` was removed from Doctrine
* ``$queryBuilder->execute()->errorInfo()`` was removed from Doctrine
* ``$queryBuilder->execute()->setFetchMode()`` was removed from Doctrine
* ``$connection->prepare()->execute()`` previously returned ``false`` under some error conditions, it now always gives you an ``IResult`` or throws an exception
* ``\Doctrine\DBAL\Types\Type::*`` type constants were moved, which some apps used for column type constants in apps. Use ``\Doctrine\DBAL\Types\Types::*`` or inline the values.
* ``$connection->prepare()->execute()`` previously returned ``false`` under some error conditions, it now always gives you an ``IResult`` or throws a ``\OCP\DB\Exception``.
* ``\Doctrine\DBAL\Types\Type::*`` type constants were moved, which some apps used for column type constants in apps. Use the new ``\OCP\DB\Types::*`` as a replacement.

The details of this change can also be seen in the `pull request on Github <https://github.com/nextcloud/server/pull/24948>`__ and in the upstream `dbal 3.0.xx upgrade document <https://github.com/doctrine/dbal/blob/3.0.x/UPGRADE.md>`__.

Expand Down
2 changes: 1 addition & 1 deletion developer_manual/basics/storage/migrations.rst
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ With this step the new column gets created:

$table = $schema->getTable('twofactor_backupcodes');

$table->addColumn('user_id', Types::STRING, [
$table->addColumn('user_id', \OCP\DB\Types::STRING, [
'notnull' => true,
'length' => 64,
]);
Expand Down