Ok... I finally got around to trying this and no joy...

newEntityTable.newBooleanColumn("newAttribute", false);


 it creates (from psql):

newattribute | character varying(5) | not null

Maybe there is no way to create a boolean value using Migrations. (Maybe there 
is if I could fix it but I don't have the skill set.)

Thanks anyway.

Ted


--- On Sat, 8/30/08, Mitchell Smith <[EMAIL PROTECTED]> wrote:

> From: Mitchell Smith <[EMAIL PROTECTED]>
> Subject: Re: migrations and boolean values
> To: [EMAIL PROTECTED]
> Date: Saturday, August 30, 2008, 1:51 PM
> Hi,
> 
> We had this very same issue in a recent project, and we
> ended up using 
> varchar fields for the Boolean columns, mainly because that
> is how it is 
> done when prototyping for Frontbase, so we jsut carried
> that same logic 
> through to Postgres.
> 
> However, you can generate a bool field in your migration
> with something 
> like:
> 
> PeopleTable.newBooleanColumn(name, allowsNull)
> 
> Which creates a colum of type "bool" in Postgres.
> 
> We did run in to some problems when modeling this column
> type to a Boolean C 
> however.
> 
> I hope this helps.
> 
> Cheers,
> 
> Mitch
> 
> 
> ----- Original Message ----- 
> From: <[EMAIL PROTECTED]>
> To: <[email protected]>
> Sent: Thursday, August 28, 2008 12:59 AM
> Subject: migrations and boolean values
> 
> 
> >I am trying to use migrations to set up a boolean data
> type column in 
> >postgresql. I have tried:
> >
> > peopleTable.newColumn("c_isactive",
> java.sql.Types.BOOLEAN, 0, 0, 0, true, 
> > "");
> >
> > or:
> >
> > peopleTable.newColumn("c_isactive", 16, 0,
> 0, 0, true, "");
> >
> > when I examine the pg table, c_isactive is a bytea
> data type.
> >
> > maybe there is no way to get to the boolean type?
> >
> > what I'm looking for is:
> >
> > CREATE TABLE t_people (c_isactive bool, c_note text);
> >
> > any ideas what I am doing wrong. also interesting,
> when I google on 
> > java.sql.Types, there is no boolean type listed in any
> of the referenced 
> > pages.
> >
> > I'd love to hear that I am just doing something
> wrong.
> >
> > Ted
> >
> >
> >
> > _______________________________________________
> > Do not post admin requests to the list. They will be
> ignored.
> > Webobjects-dev mailing list     
> ([email protected])
> > Help/Unsubscribe/Update your Subscription:
> >
> http://lists.apple.com/mailman/options/webobjects-dev/mjsotn%40gmail.com
> >
> > This email sent to [EMAIL PROTECTED]
> >


      
 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list      ([email protected])
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]

Reply via email to