DDC-2469: SQLite handling for ENUM-Fields #3098

Closed
opened 2026-01-22 14:12:10 +01:00 by admin · 3 comments
Owner

Originally created by @doctrinebot on GitHub (May 24, 2013).

Originally assigned to: @Ocramius on GitHub.

Jira issue originally created by user rosslau@my-hammer.de:

SQLite doesn't support ENUMS!

But when I try create the schema of the following Entity Doctrine generates this "CREATE TABLE" - Statement:

CREATE TABLE Entity ([...] NOT NULL, taxation ENUM('incl', 'excl'), maxNumbe[...]
class Entity {
...

    /****
     * @var string
     *
     * @ORM\Column(type="string", columnDefinition="ENUM('incl', 'excl')")
     */
    private $taxation = self::TAXATION_INCL;

...
}

Produces this error:

{color:red}SQLSTATE[HY000]: General error: 1 near "'incl'": syntax error'{color}

Originally created by @doctrinebot on GitHub (May 24, 2013). Originally assigned to: @Ocramius on GitHub. Jira issue originally created by user rosslau@my-hammer.de: SQLite doesn't support ENUMS! But when I try create the schema of the following Entity Doctrine generates this "CREATE TABLE" - Statement: ``` CREATE TABLE Entity ([...] NOT NULL, taxation ENUM('incl', 'excl'), maxNumbe[...] ``` ``` class Entity { ... /**** * @var string * * @ORM\Column(type="string", columnDefinition="ENUM('incl', 'excl')") */ private $taxation = self::TAXATION_INCL; ... } ``` --- Produces this error: {color:red}**SQLSTATE[HY000]: General error: 1 near "'incl'": syntax error'**{color}
admin added the Bug label 2026-01-22 14:12:10 +01:00
admin closed this issue 2026-01-22 14:12:10 +01:00
Author
Owner

@doctrinebot commented on GitHub (May 24, 2013):

@doctrinebot commented on GitHub (May 24, 2013): - relates to [DBAL-4: missing column type "enum"](http://www.doctrine-project.org/jira/browse/DBAL-4)
Author
Owner

@doctrinebot commented on GitHub (May 24, 2013):

Comment created by @ocramius:

Usage of columnDefinition in annotations or generally metadata mappings is all about vendor specific syntax. columnDefinition is designed to allow overriding the default ORM column generated DDL to build vendor specific syntax/types, therefore the issue is invalid

@doctrinebot commented on GitHub (May 24, 2013): Comment created by @ocramius: Usage of `columnDefinition` in annotations or generally metadata mappings is all about vendor specific syntax. `columnDefinition` is designed to allow overriding the default ORM column generated DDL to build vendor specific syntax/types, therefore the issue is invalid
Author
Owner

@doctrinebot commented on GitHub (May 24, 2013):

Issue was closed with resolution "Invalid"

@doctrinebot commented on GitHub (May 24, 2013): Issue was closed with resolution "Invalid"
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: doctrine/archived-orm#3098