UPGRADE 5.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158
  1. # Upgrade to 2.4
  2. ## Doctrine\DBAL\Schema\Constraint
  3. If you have custom classes that implement the constraint interface, you have to implement
  4. an additional method ``getQuotedColumns`` now. This method is used to build proper constraint
  5. SQL for columns that need to be quoted, like keywords reserved by the specific platform used.
  6. The method has to return the same values as ``getColumns`` only that those column names that
  7. need quotation have to be returned quoted for the given platform.
  8. # Upgrade to 2.3
  9. ## Oracle Session Init now sets Numeric Character
  10. Before 2.3 the Oracle Session Init did not care about the numeric character of the Session.
  11. This could lead to problems on non english locale systems that required a comma as a floating
  12. point seperator in Oracle. Since 2.3, using the Oracle Session Init on connection start the
  13. client session will be altered to set the numeric character to ".,":
  14. ALTER SESSION SET NLS_NUMERIC_CHARACTERS = '.,'
  15. See [DBAL-345](http://www.doctrine-project.org/jira/browse/DBAL-345) for more details.
  16. ## Doctrine\DBAL\Connection and Doctrine\DBAL\Statement
  17. The query related methods including but not limited to executeQuery, exec, query, and executeUpdate
  18. now wrap the driver exceptions such as PDOException with DBALException to add more debugging
  19. information such as the executed SQL statement, and any bound parameters.
  20. If you want to retrieve the driver specific exception, you can retrieve it by calling the
  21. ``getPrevious()`` method on DBALException.
  22. Before:
  23. catch(\PDOException $ex) {
  24. // ...
  25. }
  26. After:
  27. catch(\Doctrine\DBAL\DBALException $ex) {
  28. $pdoException = $ex->getPrevious();
  29. // ...
  30. }
  31. ## Doctrine\DBAL\Connection#setCharsetSQL() removed
  32. This method only worked on MySQL and it is considered unsafe on MySQL to use SET NAMES UTF-8 instead
  33. of setting the charset directly on connection already. Replace this behavior with the
  34. connection charset option:
  35. Before:
  36. $conn = DriverManager::getConnection(array(..));
  37. $conn->setCharset('UTF8');
  38. After:
  39. $conn = DriverManager::getConnection(array('charset' => 'UTF8', ..));
  40. ## Doctrine\DBAL\Schema\Table#renameColumn() removed
  41. Doctrine\DBAL\Schema\Table#renameColumn() was removed, because it drops and recreates
  42. the column instead. There is no fix available, because a schema diff
  43. cannot reliably detect if a column was renamed or one column was created
  44. and another one dropped.
  45. You should use explicit SQL ALTER TABLE statements to change columns names.
  46. ## Schema Filter paths
  47. The Filter Schema assets expression is not wrapped in () anymore for the regexp automatically.
  48. Before:
  49. $config->setFilterSchemaAssetsExpression('foo');
  50. After:
  51. $config->setFilterSchemaAssetsExpression('(foo)');
  52. ## Creating MySQL Tables now defaults to UTF-8
  53. If you are creating a new MySQL Table through the Doctrine API, charset/collate are
  54. now set to 'utf8'/'utf8_unicode_ci' by default. Previously the MySQL server defaults were used.
  55. # Upgrade to 2.2
  56. ## Doctrine\DBAL\Connection#insert and Doctrine\DBAL\Connection#update
  57. Both methods now accept an optional last parameter $types with binding types of the values passed.
  58. This can potentially break child classes that have overwritten one of these methods.
  59. ## Doctrine\DBAL\Connection#executeQuery
  60. Doctrine\DBAL\Connection#executeQuery() got a new last parameter "QueryCacheProfile $qcp"
  61. ## Doctrine\DBAL\Driver\Statement split
  62. The Driver statement was split into a ResultStatement and the normal statement extending from it.
  63. This separates the configuration and the retrieval API from a statement.
  64. ## MsSql Platform/SchemaManager renamed
  65. The MsSqlPlatform was renamed to SQLServerPlatform, the MsSqlSchemaManager was renamed
  66. to SQLServerSchemaManager.
  67. ## Cleanup SQLServer Platform version mess
  68. DBAL 2.1 and before were actually only compatible to SQL Server 2008, not earlier versions.
  69. Still other parts of the platform did use old features instead of newly introduced datatypes
  70. in SQL Server 2005. Starting with DBAL 2.2 you can pick the Doctrine abstraction exactly
  71. matching your SQL Server version.
  72. The PDO SqlSrv driver now uses the new `SQLServer2008Platform` as default platform.
  73. This platform uses new features of SQL Server as of version 2008. This also includes a switch
  74. in the used fields for "text" and "blob" field types to:
  75. "text" => "VARCHAR(MAX)"
  76. "blob" => "VARBINARY(MAX)"
  77. Additionally `SQLServerPlatform` in DBAL 2.1 and before used "DATE", "TIME" and "DATETIME2" for dates.
  78. This types are only available since version 2008 and the introduction of an explicit
  79. SQLServer 2008 platform makes this dependency explicit.
  80. An `SQLServer2005Platform` was also introduced to differentiate the features between
  81. versions 2003, earlier and 2005.
  82. With this change the `SQLServerPlatform` now throws an exception for using limit queries
  83. with an offset, since SQLServer 2003 and lower do not support this feature.
  84. To use the old SQL Server Platform, because you are using SQL Server 2003 and below use
  85. the following configuration code:
  86. use Doctrine\DBAL\DriverManager;
  87. use Doctrine\DBAL\Platforms\SQLServerPlatform;
  88. use Doctrine\DBAL\Platforms\SQLServer2005Platform;
  89. // You are using SQL Server 2003 or earlier
  90. $conn = DriverManager::getConnection(array(
  91. 'driver' => 'pdo_sqlsrv',
  92. 'platform' => new SQLServerPlatform()
  93. // .. additional parameters
  94. ));
  95. // You are using SQL Server 2005
  96. $conn = DriverManager::getConnection(array(
  97. 'driver' => 'pdo_sqlsrv',
  98. 'platform' => new SQLServer2005Platform()
  99. // .. additional parameters
  100. ));
  101. // You are using SQL Server 2008
  102. $conn = DriverManager::getConnection(array(
  103. 'driver' => 'pdo_sqlsrv',
  104. // 2008 is default platform
  105. // .. additional parameters
  106. ));