Jira issue originally created by user adrive:
When I have a boolean column(s) in my entities and I want to update schema with schema tool, I get an exception:
/*** @Entity @Table(name='st_node') **/
/*** @Id @Column(type="integer") @GeneratedValue **/
/*** @Column(type="string", length="255") **/
/*** @Column(type="boolean", nullable=false) **/
/*** @Column(type="boolean") **/
/*** @Column(type="integer", length=4) **/
/*** @Column(type="decimal", precision=4, scale=2) **/
./doctrine orm:schema-tool:update --force
Updating database schema...
ORA-01442: column to be modified to NOT NULL is already NOT NULL
The same with --dump-sql option:
./doctrine orm:schema-tool:update --dump-sql
ALTER TABLE ST*NODE MODIFY (is_published NUMBER(1) NOT NULL, is*sticky NUMBER(1) NOT NULL)
The columns are already not nulls, but schema-tool can't recognize that.
This is the DQL of the table:
CREATE TABLE "DOCTRINE"."ST_NODE"
"ID" NUMBER(10,0) NOT NULL ENABLE,
"TITLE" VARCHAR2(255 BYTE) NOT NULL ENABLE,
"DISCR" VARCHAR2(255 BYTE) NOT NULL ENABLE,
"IS_PUBLISHED" NUMBER(1,0) NOT NULL ENABLE,
"HITS" NUMBER(10,0) NOT NULL ENABLE,
"SCORE" NUMBER(4,2) NOT NULL ENABLE,
"IS_STICKY" NUMBER(1,0) NOT NULL ENABLE,
PRIMARY KEY ("ID")
Comment created by adrive:
Fixed in https://github.com/milokmet/dbal/commits/[DBAL-67](http://www.doctrine-project.org/jira/browse/DBAL-67)
Comment created by @beberlei:
Btw, with regard to the comment on the Fix on your repository.
What has the commit to do with the NULL / NOT NULL issue? it seems the changes are entirely unrelated to this?
Hi Benjamin, No the changes are not unrelated to this, but I discover, what the problem was.
The problem was, thet the changed function didn't map correctly the database column types to the doctrine's types.
Therefor, when I have is_published column of doctrine's boolean type, it is mapped to oracle's NUMBER(1), but when I want to update the schema, doctrine schema managers thinks, that existing column in the database is integer with precision 1, and tries to modify the column to boolean -> number(1), but the column already is number(1) and oracle complains.
The same is also with bigint and smallint.
Issue was closed with resolution "Fixed"