From ac004090c23fd02689134e911623ebedc958c8f2 Mon Sep 17 00:00:00 2001 From: Mark Story Date: Mon, 8 Jul 2024 00:38:22 -0400 Subject: [PATCH 1/2] Adding docs for cakephp/cakephp#17733 --- en/appendices/5-1-migration-guide.rst | 4 ++++ en/orm/database-basics.rst | 23 +++++++++++++++++++++++ 2 files changed, 27 insertions(+) diff --git a/en/appendices/5-1-migration-guide.rst b/en/appendices/5-1-migration-guide.rst index e3c1e2dba1..7d026f2ec9 100644 --- a/en/appendices/5-1-migration-guide.rst +++ b/en/appendices/5-1-migration-guide.rst @@ -85,6 +85,10 @@ Controller Database -------- +- Support for ``point``, ``linestring``, ``polygon`` and ``geometry`` types were + added. These types are useful when working with geospatial or cartesian + co-ordinates. Sqlite support uses text columns under the hood and lacks + functions to manipulate data as geospatial values. - ``SelectQuery::__debugInfo()`` now includes which connection role the query is for. diff --git a/en/orm/database-basics.rst b/en/orm/database-basics.rst index 4337120538..40dde2e1e2 100644 --- a/en/orm/database-basics.rst +++ b/en/orm/database-basics.rst @@ -400,6 +400,14 @@ json Maps to a ``JSON`` type if it's available, otherwise it maps to ``TEXT``. enum See :ref:`enum-type`. +geometry + Maps to a generic geometry storage type. +point + Maps to a single point in geospatial storage. +linestring + Maps to a single line in geospatial storage. +polygon + Maps to a single polygon in geospatial storage. These types are used in both the schema reflection features that CakePHP provides, and schema generation features CakePHP uses when using test fixtures. @@ -411,6 +419,10 @@ automatically convert input parameters from ``DateTime`` instances into a timestamp or formatted datestrings. Likewise, 'binary' columns will accept file handles, and generate file handles when reading data. +.. versionchanged:: 5.1.0 + The ``geometry``, ``point``, ``linestring``, and ``polygon`` types were + added. + .. _datetime-type: DateTime Type @@ -491,6 +503,17 @@ CakePHP recommends a few conventions for enums: - Enums should implement the ``Cake\Database\Type\EnumLabelInterface`` to improve compatibility with bake, and ``FormHelper``. +Geospatial Types +---------------- + +The ``geometry``, ``point``, ``linestring``, and ``polygon`` types are also known +as the "geospatial types". CakePHP offers limited support for geospatial +columns. Currently they can be defined in migrations, read in schema reflection, +and have values set as text. + +.. versionadded:: 5.1.0 + Geospatial schema types were added. + .. _adding-custom-database-types: From b774392f8751191623945bd8aeb5f02ade67aa03 Mon Sep 17 00:00:00 2001 From: Mark Story Date: Mon, 8 Jul 2024 00:54:14 -0400 Subject: [PATCH 2/2] Fix whitespace --- en/orm/database-basics.rst | 1 - 1 file changed, 1 deletion(-) diff --git a/en/orm/database-basics.rst b/en/orm/database-basics.rst index 40dde2e1e2..2b43457b2b 100644 --- a/en/orm/database-basics.rst +++ b/en/orm/database-basics.rst @@ -514,7 +514,6 @@ and have values set as text. .. versionadded:: 5.1.0 Geospatial schema types were added. - .. _adding-custom-database-types: Adding Custom Types