Y/N values have been intelligently replaced with true/false.
Unfortunately, I need precisely string Y/N values.
But more critical issue is that the default value was left unchanged.
Thus, when I try to create tables (`symfony doctrine:build-db` or
`:rebuild-db`), I expectedly receive a complain that 'N' is invalid
value.
Moreover, if I build SQL schema (`symfony doctrine:build-sql`), I get
the following result:
is_public ENUM('1', '') DEFAULT 'N' NOT NULL,
because PHP converts FALSE to an empty string, not a zero.
In the yaml parser, just Y or N will be parsed in to PHP true or false. If
you want the actual value to be a string Y and string N then you need to
make sure to wrap it in single quotes.
You could also do this.
is_public as isPublic:
type: enum
values: [Y, N]
default: N
notnull: true
That would be all boolean, but that would just be this.
is_public as isPublic:
type: boolean
default: false
> Y/N values have been intelligently replaced with true/false.
> Unfortunately, I need precisely string Y/N values.
> But more critical issue is that the default value was left unchanged.
> Thus, when I try to create tables (`symfony doctrine:build-db` or
> `:rebuild-db`), I expectedly receive a complain that 'N' is invalid
> value.
> Moreover, if I build SQL schema (`symfony doctrine:build-sql`), I get
> the following result:
> is_public ENUM('1', '') DEFAULT 'N' NOT NULL,
> because PHP converts FALSE to an empty string, not a zero.
-- Jonathan H. Wage (+1 415 992 5468)
Open Source Software Developer & Evangelist
sensiolabs.com | jwage.com | doctrine-project.org | symfony-project.org
You can contact Jonathan about Doctrine, Symfony and Open-Source or for
training, consulting, application development, or business related questions
at jonathan.w...@sensio.com
> In the yaml parser, just Y or N will be parsed in to PHP true or false. If > you want the actual value to be a string Y and string N then you need to > make sure to wrap it in single quotes.
> You could also do this.
> is_public as isPublic: > type: enum > values: [Y, N] > default: N > notnull: true
> That would be all boolean, but that would just be this.
> is_public as isPublic: > type: boolean > default: false
> Which is what I would recommend to use.
> - Jon
> On Thu, Oct 8, 2009 at 7:51 PM, Eugene Janusov<esy...@gmail.com> wrote:
>> Hi,
>> I'm using symfony, but I suppose my problem is related only to >> Doctrine.
>> Y/N values have been intelligently replaced with true/false. >> Unfortunately, I need precisely string Y/N values. >> But more critical issue is that the default value was left unchanged. >> Thus, when I try to create tables (`symfony doctrine:build-db` or >> `:rebuild-db`), I expectedly receive a complain that 'N' is invalid >> value.
>> Moreover, if I build SQL schema (`symfony doctrine:build-sql`), I get >> the following result:
>> is_public ENUM('1', '') DEFAULT 'N' NOT NULL,
>> because PHP converts FALSE to an empty string, not a zero.