Skip to content

Commit ac00409

Browse files
committed
Adding docs for cakephp/cakephp#17733
1 parent 68d52e1 commit ac00409

File tree

2 files changed

+27
-0
lines changed

2 files changed

+27
-0
lines changed

en/appendices/5-1-migration-guide.rst

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,10 @@ Controller
8585
Database
8686
--------
8787

88+
- Support for ``point``, ``linestring``, ``polygon`` and ``geometry`` types were
89+
added. These types are useful when working with geospatial or cartesian
90+
co-ordinates. Sqlite support uses text columns under the hood and lacks
91+
functions to manipulate data as geospatial values.
8892
- ``SelectQuery::__debugInfo()`` now includes which connection role the query
8993
is for.
9094

en/orm/database-basics.rst

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -400,6 +400,14 @@ json
400400
Maps to a ``JSON`` type if it's available, otherwise it maps to ``TEXT``.
401401
enum
402402
See :ref:`enum-type`.
403+
geometry
404+
Maps to a generic geometry storage type.
405+
point
406+
Maps to a single point in geospatial storage.
407+
linestring
408+
Maps to a single line in geospatial storage.
409+
polygon
410+
Maps to a single polygon in geospatial storage.
403411

404412
These types are used in both the schema reflection features that CakePHP
405413
provides, and schema generation features CakePHP uses when using test fixtures.
@@ -411,6 +419,10 @@ automatically convert input parameters from ``DateTime`` instances into a
411419
timestamp or formatted datestrings. Likewise, 'binary' columns will accept file
412420
handles, and generate file handles when reading data.
413421

422+
.. versionchanged:: 5.1.0
423+
The ``geometry``, ``point``, ``linestring``, and ``polygon`` types were
424+
added.
425+
414426
.. _datetime-type:
415427

416428
DateTime Type
@@ -491,6 +503,17 @@ CakePHP recommends a few conventions for enums:
491503
- Enums should implement the ``Cake\Database\Type\EnumLabelInterface`` to
492504
improve compatibility with bake, and ``FormHelper``.
493505

506+
Geospatial Types
507+
----------------
508+
509+
The ``geometry``, ``point``, ``linestring``, and ``polygon`` types are also known
510+
as the "geospatial types". CakePHP offers limited support for geospatial
511+
columns. Currently they can be defined in migrations, read in schema reflection,
512+
and have values set as text.
513+
514+
.. versionadded:: 5.1.0
515+
Geospatial schema types were added.
516+
494517

495518
.. _adding-custom-database-types:
496519

0 commit comments

Comments
 (0)