Unknown column type "dateinterval" requested #5583

Closed
opened 2026-01-22 15:11:58 +01:00 by admin · 3 comments
Owner

Originally created by @Kwadz on GitHub (Jun 21, 2017).

The documentation mentions we can use dateinterval type.

However when I try to use it like:

    /**
     * @ORM\Column(type="dateinterval")
     */
    private $updateInterval;

I get:

  [Doctrine\DBAL\DBALException]
  Unknown column type "dateinterval" requested. Any Doctrine type that you use has to be registered with \Doctrine\
  DBAL\Types\Type::addType(). You can get a list of all the known types with \Doctrine\DBAL\Types\Type::getTypesMap
  (). If this error occurs during database introspection then you might have forgot to register all database types
  for a Doctrine Type. Use AbstractPlatform#registerDoctrineTypeMapping() or have your custom types implement Type#
  getMappedDatabaseTypes(). If the type name is empty you might have a problem with the cache or forgot some mappin
  g information.

I am using doctrine/dbal v2.5.12 and doctrine/orm v2.5.6.

Originally created by @Kwadz on GitHub (Jun 21, 2017). The [documentation](http://docs.doctrine-project.org/projects/doctrine-dbal/en/latest/reference/types.html#dateinterval) mentions we can use `dateinterval` type. However when I try to use it like: ``` /** * @ORM\Column(type="dateinterval") */ private $updateInterval; ``` I get: ``` [Doctrine\DBAL\DBALException] Unknown column type "dateinterval" requested. Any Doctrine type that you use has to be registered with \Doctrine\ DBAL\Types\Type::addType(). You can get a list of all the known types with \Doctrine\DBAL\Types\Type::getTypesMap (). If this error occurs during database introspection then you might have forgot to register all database types for a Doctrine Type. Use AbstractPlatform#registerDoctrineTypeMapping() or have your custom types implement Type# getMappedDatabaseTypes(). If the type name is empty you might have a problem with the cache or forgot some mappin g information. ``` I am using `doctrine/dbal` v2.5.12 and `doctrine/orm` v2.5.6.
admin added the InvalidQuestion labels 2026-01-22 15:11:58 +01:00
admin closed this issue 2026-01-22 15:11:58 +01:00
Author
Owner

@Ocramius commented on GitHub (Jun 21, 2017):

@Kwadz that's only for DBAL master (2.6) as per https://github.com/doctrine/dbal/pull/854

@Ocramius commented on GitHub (Jun 21, 2017): @Kwadz that's only for DBAL `master` (`2.6`) as per https://github.com/doctrine/dbal/pull/854
Author
Owner

@Kwadz commented on GitHub (Jun 21, 2017):

@Ocramius In this case, to avoid confusion, may be we should mention it in the doc like it's done for datetime-immutable with:

Available since version 2.6.

@Kwadz commented on GitHub (Jun 21, 2017): @Ocramius In this case, to avoid confusion, may be we should mention it in the doc like it's done for [datetime-immutable](http://docs.doctrine-project.org/projects/doctrine-dbal/en/latest/reference/types.html#datetime-immutable) with: > Available since version 2.6.
Author
Owner

@Ocramius commented on GitHub (Jun 21, 2017):

@Kwadz that's a long standing issue with the documentation in general: we want to split it at RST compilation level, but never managed to do so.

See https://github.com/doctrine/doctrine-website-sphinx/issues/149

@Ocramius commented on GitHub (Jun 21, 2017): @Kwadz that's a long standing issue with the documentation in general: we want to split it at RST compilation level, but never managed to do so. See https://github.com/doctrine/doctrine-website-sphinx/issues/149
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: doctrine/archived-orm#5583