From 730f23cbee99d3a81ae9232c65192f22409fe70c Mon Sep 17 00:00:00 2001 From: Christoph Wurst Date: Fri, 15 Jan 2021 10:12:29 +0100 Subject: [PATCH 1/2] Recommend our own type constants instead of Doctrine's Signed-off-by: Christoph Wurst --- developer_manual/app_publishing_maintenance/upgrade-guide.rst | 2 +- developer_manual/basics/storage/migrations.rst | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/developer_manual/app_publishing_maintenance/upgrade-guide.rst b/developer_manual/app_publishing_maintenance/upgrade-guide.rst index f52a75a2920..b53a49004a8 100644 --- a/developer_manual/app_publishing_maintenance/upgrade-guide.rst +++ b/developer_manual/app_publishing_maintenance/upgrade-guide.rst @@ -46,7 +46,7 @@ Some (minor) breaking changes were inevitable. Here's the summary * ``$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. +* ``\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 `__ and in the upstream `dbal 3.0.xx upgrade document `__. diff --git a/developer_manual/basics/storage/migrations.rst b/developer_manual/basics/storage/migrations.rst index b1b54fe5472..95112b1f038 100644 --- a/developer_manual/basics/storage/migrations.rst +++ b/developer_manual/basics/storage/migrations.rst @@ -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, ]); From e63a3940ca44920cdaa5d61d7047c9b6e3d9caab Mon Sep 17 00:00:00 2001 From: Christoph Wurst Date: Fri, 15 Jan 2021 10:19:37 +0100 Subject: [PATCH 2/2] Add note about the new database exception and the dropped dbal one Signed-off-by: Christoph Wurst --- developer_manual/app_publishing_maintenance/upgrade-guide.rst | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/developer_manual/app_publishing_maintenance/upgrade-guide.rst b/developer_manual/app_publishing_maintenance/upgrade-guide.rst index b53a49004a8..0c9d7285cca 100644 --- a/developer_manual/app_publishing_maintenance/upgrade-guide.rst +++ b/developer_manual/app_publishing_maintenance/upgrade-guide.rst @@ -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. @@ -45,7 +46,7 @@ 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 +* ``$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 `__ and in the upstream `dbal 3.0.xx upgrade document `__.