Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding docs for cakephp/cakephp#17733 #7884

Merged
merged 2 commits into from
Jul 9, 2024
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
4 changes: 4 additions & 0 deletions en/appendices/5-1-migration-guide.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Expand Down
22 changes: 22 additions & 0 deletions en/orm/database-basics.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -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
Expand Down Expand Up @@ -491,6 +503,16 @@ 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:

Expand Down